September 6, 2000
Noting an increasing interest in XML Schemas on several mailing lists, this week the XML Deviant takes a look at some of the resources available to the aspiring schema developer.
The first goal for anyone seeking to come to grips with XML Schemas is gathering useful reference material. The XML Schema Primer, a useful introduction and overview of the topic, is published by the Schema Working Group in response to requests from the community for additional documentation.
The terseness of the schema specifications will drive most developers toward tutorial materials. Unfortunately there are few updated tutorials available at the present. Two exceptions worth noting are Ashvin Radiya's introduction to the basics of using XML Schema (from IBM developerWorks) and Roger Costello's Xfront Schema tutorial. The latter is very well researched. Costello clarified many areas with members of the Working Group. The tutorial, which is available under the GPL, includes many examples which have been tested against several schema validators.
After tackling the documentation, the next step is to set to work on some schemas of your own. Anticipating this, and in an effort to get feedback on the working drafts, the Schema WG developed XSV, a open source schema validation tool in Python. XSV is available for download and as an online validation service, but it isn't entirely conformant.
Several parsers now provide limited support for schemas. The Oracle Java, C and C++ toolkits include schema processors. The recently released 1.2 version of Xerces-J does as well, although it's not fully conformant. It's clear that Schema conformance testing will become essential once the specifications stabilize.
One notable absence in the schema developer's tool kit is the ability to generate supporting documentation for a schema. A tool is needed that will do for schemas what Earl Hood's Perl tool dtd2html does for DTDs. Developers Rodney Lai on XML-L and David Valera on XML-DEV have been looking for such a tool:
Does anyone know if there is an XSL available for XML schema that does the same as the XDR stylesheet from Microsoft?
The XDR stylesheet generates documentation about the XDR in a more human readable way. I wonder if there is such a stylesheet for W3C schema's...
Henry Thompson noted that the XSLT stylesheet used to generate the Working Draft documentation could form the basis of such a facility.
[The stylesheet] used to format the XML Schema WDs themselves uses the schema document for schemas to generate the displays at the head of each section in chapter 4... You could easily extract only the templates that apply to elements in the XML Schema namespace.
XSLT developers looking for an interesting and challenging project could do worse than examine the possibilities of generating useful HTML documentation directly from a schema description. Paul Spencer observed that he has already implemented a subset of the required functionality:
I did something for XDR schemas ...which I preferred to the Microsoft one, especially for large schemas. I looked at doing something similar for XML Schema, but it is much more complex, and so have only done a subset so far.
Of course XML Schema is not the only schema language available. One popular alternative is RELAX. Murata Makoto announced this week that RELAX will be submitted to ISO for standardization
Technical committee of JISC (Japanese Industrial Standards Committee) ... and Technical Committee of ITSCJ (Information Technology Standards Commission of Japan) ... [have] jointly decided that RELAX Core shall be submitted to the fast-track procedure of ISO. Submission is expected to take place in early October, 2000.
RELAX has long been positioned as a stepping stone between DTDs and XML Schemas. ISO standardization is unlikely to change that, but it will raise the profile of RELAX considerably. The wrangling between schema languages is far from over, but without support in the brand-name parsers like Xerces, it's difficult to see how RELAX can supplant the alternatives.