Ian's books |
CPU Magazine
Introduction to XML Schema
As described in the July 2004 issue of
CPU - Computer Power User
magazine.
Examples
A) Downloadable ZIP File
-
There are several examples here -- why not download the whole lot
as a ZIP file -- jul04.zip -- and install
them on your own machine?
B) The example XML documents
To play with these documents, simply load them into an XML editor and test them
for validity, or load them into a browser and view the results. Some editors will
test for validity automatically as the file is loaded, while others will require
that you select to validate.
- stuff.dtd : (plain text version: stuff.txt)
The example DTD that models our "list of physicists" document.
- example-1.xml : (plain text version: example-1.txt)
XML document containing the list of physicsts, and referencing the DTD in an external subset (stuff.dtd
).
- stuff2.xsd -- (plain text version: stuff2.txt)
An XML schema document equivalent to the DTD defined in stuff.dtd
. This schema document uses global
element definitions, as discussed in the article.
- example-2.xml -- (plain text version: example-2.txt)
XML document containing the list of physicists (same content as example-1.xml
), but referencing an external
XML schema file (stuff2.xsd
).
- stuff-local.xsd -- (plain text version:
stuff-local.txt)
An XML schema document equivalent to stuff2.xsd
, but with local as opposed to global element
definitions.
C) Some XML Editors with Validation Features
See the listing provided in the March 2004 CPU article (http://www.iangraham.org/writing/cpu-articles/mar04/).