[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: XML Schemas: Best Practices
- From: "Roger L. Costello" <costello@mitre.org>
- To: xml-dev@lists.xml.org
- Date: Sat, 31 Mar 2001 14:35:02 -0500
Subject: Tutorial on Extending XML Schemas
I have put together a step-by-step tutorial on extending XML Schemas
(with either XSLT/XPath or Schematron). It contains fully worked
examples, labs (with answers), and batch scripts for running the
examples/labs. The tutorial may be downloaded from the Best Practice
Homepage:
http://www.xfront.com/BestPracticeHomepage.html
The tandem of {XSLT/XPath and XML Schemas} or {Schematron and XML
Schemas} is very powerful. I am very excited about this approach.
Here's a preview of what is covered in the tutorial:
- XML Schemas is very powerful
- However, it is not "all powerful". There are many constraints
that it cannot express. Here are some examples:
. Ensure that the value of the aircraft <Elevation> element
is greater than the value of the obstacle <Height> element.
. Ensure that:
- if the value of the attribute, mode, is "air", then the
value of the element, <Transportation>, is either
airplane or hot-air balloon,
- if mode="water" then <Transportation> is either boat
or hovercraft,
- if mode="ground" then <Transportation> is either car
or bicycle.
. Ensure that the value of the <PaymentReceived> is equal to
the value of <PaymentDue>, where these elements are in
separate documents!
- To check all our constraints we need to supplement XML
Schemas with another tool. In this tutorial we cover each
of these examples and show how the constraints may be implemented
using either XSLT/XPath or Schematron. At the end we examine
the pros and cons of each approach.
...
I would like to thank Eddie Robertsson and Rick Jelliffe for helping me
understand the wonderful power of Schematron. /Roger