Convert CSV to XML using an existing XSD

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

Convert CSV to XML using an existing XSD

Tue Jun 21, 2011 3:22 pm

I am new to oxygen, any help would be appreciated. I have an XSD and a CSV to match. I need to convert the CSV to XML and follow the XSD mappings. Can anyone help get me started or point me to an existing post that would cover this? Thanks.
adrian
Posts: 2442

Re: Convert CSV to XML using an existing XSD

Tue Jun 21, 2011 5:28 pm

Hello,

Unfortunately Oxygen doesn't provide any automatic means to map the data from a CSV file to an XML document that conforms to an XML schema.

This has to be done manually in two steps:
1. Import the CSV to an XML file
File -> Import -> Text File. Browse for the .csv file and press OK. You will obtain the Import criteria dialog that allows you to choose the field delimiter from the CSV and customize the form of the destination XML file(Change labels).

2.
a) Process the imported XML file either manually or by transforming it with an XSLT stylesheet to conform to the schema.

or

b) Generate a sample XML Instance(Tools -> Generate Sample XML Files) from the XML schema and use the Grid mode(Document -> Edit Mode -> Grid) for both files for transferring the data(copy/paste) from the imported XML to the sample XML instance that's been generated.

You can dock the editors side by side(click and drag an editor tab to the left or to the right side) to follow both files at the same time. Restore them to the default stacked layout by using Window -> Stack Editors

You can find a similar discussion here:
match data to schema

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 1 guest