Ian's books |
CPU Magazine
XML schemas Using RELAX NG
As described in the April 2005 issue of
CPU - Computer Power User
magazine.
This Web page provides examples related to the CPU article on RELAX
NG (RNG), and also links to RNG information and tutorials. Enjoy! And if
you like RNG, please remember that thanks should go the creators of that
language, Murata Makato and James Clark.
Examples - Downloadable ZIP File
- There are some examples files here -- why not download the
whole lot as a ZIP file -- apr05.zip
-- and install them on your own machine?
A) Information about RELAX NG
This sections lists useful resources for informaton about schematron, including specifications and
tutorials.
B) Example XML File and RNG Schemas
- Example XML document -- test1.xml (plain text: test1.txt)
- Example DTD -- dtd1.dtd (plain text: dtd1.txt)
- Example RNG schema -- relax1.rng (plain text: relax1.txt)
- Second Example RNG schema -- relax1a.rng (plain text: relax1a.txt). This schema
is equivalent to the previous one, but shows how RNG lets you <define> element groups,
and then <ref> these groups from inside a content definition. This also introduces two
new elements: <grammar> to contain the entire grammar definition, and <start> to contain
the starting point (root element) for the grammar model.