Importing Enumerations

This should cover W3C XML Schema, Relax NG and DTD related problems.
Posts: 1
Joined: Tue Jul 16, 2013 1:37 am

Importing Enumerations

Post by Oxygen14User » 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: 2696
Joined: Tue May 17, 2005 4:01 pm

Re: Importing Enumerations

Post by adrian » 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

Post Reply