Page 1 of 1

Convert CSV file to attribute-central XML

Posted: Mon Jul 06, 2015 9:27 pm
by mklindquist
I'm trying to convert a CSV file to attribute-centric XML file. Meaning it has to look like below:

<students creationdate="2015-07-06T12:15.00PM">
<student firstname="John" lastName="Smith" id="1234567">
<address type="HOME" address1="123 Anystreet Drive" city="milwaukee" state="WI"/>
</student>
</students>

Convert CSV file to attribute-central XML

Posted: Mon Jul 06, 2015 9:44 pm
by mklindquist
Is there a way to bring a CSV file in to Oxygen XML editor and then output to an XML file that is attribute-centric?

Re: Convert CSV file to attribute-central XML

Posted: Tue Jul 07, 2015 11:50 am
by Costin
Hello,

To import CSV files in oXygen you should go into oXygen menu File > Import and choose "Text File".
In the following dialog you have the possibility to browse for the specific location of the file you want to import.

After you select the CSV file, clicking "Next" in the "Import" dialog window will get you to the next phase, where you should select "Comma" as the separator for the "Field delimiter" parameter.
If the values in your CSV document represent even the names you would like your attributes to bear, you should also enable the "First row contains field names" option, otherwise you should continue with the next step, customizing the result of the import.
For that, click on the "Customize" button present in the same dialog window right under the list of values identified in the file ("Settings" section).

In the next screen you would be directed, called "Presentation Names"(the dialog in discussion is the last but one depicted at the bottom of this page), as there is no support for batch editing of the parameters, you should manually choose the criterion used for transposing each of the identified values from your file. In your specific case, the criterion should be set as "Attribute".

Detailed information about the Import support in oXygen is available also in the oXygen XML User-Guide

Best Regards,
Costin

Re: Convert CSV file to attribute-central XML

Posted: Tue Jul 28, 2015 3:32 pm
by mklindquist
Is it possible to bring in an XSD file to have it convert to the way it is supposed to look?

Re: Convert CSV file to attribute-central XML

Posted: Tue Jul 28, 2015 4:11 pm
by adrian
Hi,

No, currently (v17.0) there is no schema mapping in Oxygen, XSD or otherwise, when converting (importing) content into XML format.

Regards,
Adrian