Importing Enumerations

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

Importing Enumerations

Tue Jul 16, 2013 1:41 am

I am trying to create an XML Schema and want to define a 'Country' field that is restricted to a set of known countries. I can type in each allowable country as an enumeration in the facets panel but, is there any way to load a list of countries into the facets panel from say a CSV or text file so I don't have type in each country enumeration by hand?
Thanks for any help
Posts: 2336

Re: Importing Enumerations

Tue Jul 16, 2013 3:33 pm


Unfortunately you can't import/load the list of countries from a file directly to the Facets panel. However, you could import a CSV/text file into XML in Oxygen (File > Import > Text File) and then post process that with an XSL to produce the xs:enumeration values.

Alternatively, instead of post-processing the XML you could use the Grid mode to copy data around.
1. First import the CSV to XML, switch to Grid mode (Document > Edit mode > Grid), select the entire list (from first to last items) and copy to clipboard.
If you have a country list formatted with one country per line, you could simply copy that to clipboard without importing it to XML.
2. Make sure you have declared at least two enumerations in the schema, switch to Grid mode (Document > Edit mode > Grid), expand it to the place where the enumeration is, select the first value and paste there the list from the clipboard.

Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger

Return to “XML Schemas”

Who is online

Users browsing this forum: No registered users and 1 guest