From Code Synthesis Wiki

< SchemasRevision as of 10:12, 3 May 2010; view current revision
←Older revision | Newer revision→
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:



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