Convert CSV file to attribute-central XML

This should cover W3C XML Schema, Relax NG and DTD related problems.
mklindquist
Posts: 3

Convert CSV file to attribute-central XML

Mon Jul 06, 2015 9:27 pm

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>
mklindquist
Posts: 3

Convert CSV file to attribute-central XML

Mon Jul 06, 2015 9:44 pm

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?
Costin
Posts: 345

Re: Convert CSV file to attribute-central XML

Tue Jul 07, 2015 11:50 am

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
Costin Sandoi
oXygen XML Editor and Author Support
mklindquist
Posts: 3

Re: Convert CSV file to attribute-central XML

Tue Jul 28, 2015 3:32 pm

Is it possible to bring in an XSD file to have it convert to the way it is supposed to look?
adrian
Posts: 2441

Re: Convert CSV file to attribute-central XML

Tue Jul 28, 2015 4:11 pm

Hi,

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

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

Return to “XML Schemas”

Who is online

Users browsing this forum: No registered users and 0 guests