Schemas/RailML

From Code Synthesis Wiki

Jump to: navigation, search

RailML is an XML-based data exchange format for railway applications.

RailML 2.0

To compile RailML 2.0 schemas perform the following steps:

1. Download xml.xsd and place it into the RailML schema directory. Remove the <DOCTYPE ..> line from this file or download XMLSchema.dtd.

2. Download dc.xsd and place it into the RailML schema directory.

3. Download mathml2.tgz from the W3 MathML page (see the Older Releases section) and unpack it into the mathml2 subdirectory in the RailML schema directory.

4. Create the gen and gen/mathml2 subdirectories in the RailML schema directory.

5. Create a file called railml.options with the following contents:

--location-map http://www.w3.org/2001/03/xml.xsd=xml.xsd
--location-map http://dublincore.org/schemas/xmls/qdc/2008/02/11/dc.xsd=dc.xsd
--location-map http://www.w3.org/Math/XMLSchema/mathml2/mathml2.xsd=mathml2/mathml2.xsd

--namespace-map http://purl.org/dc/elements/1.1/=dc
--namespace-map http://www.railml.org/schemas/2009=rml
--namespace-map http://www.w3.org/1998/Math/MathML=mml

--anonymous-regex %.* .* (.+)/(.+)%$1_$2%

--disable-warning T002
--disable-warning F001

--root-element railml

6. Compile the schemas with the following command lines:

$ xsd cxx-tree --generate-xml-schema --output-dir gen xml-schema.xsd

$ xsd cxx-tree --file-per-type --options-file railml.options --output-dir gen/mathml2 --extern-xml-schema ../xml-schema.xsd mathml2/mathml2.xsd

$ xsd cxx-tree --options-file railml.options --output-dir gen --extern-xml-schema xml-schema.xsd *.xsd

7. The generated code is in the gen/ directory and its subdirectories.

Personal tools