W3C home > Mailing lists > Public > xmlschema-dev@w3.org > March 2001

XHTML Schema generated from UML

From: Dave Carlson <dcarlson@ontogenics.com>
Date: Sun, 4 Mar 2001 20:40:49 -0700
Message-ID: <001701c0a526$14b01c00$0301a8c0@jewel>
To: <xmlschema-dev@w3.org>
I have created an XML Schema that covers all of XHTML Basic.  There are a
3-4 situations where it is a bit lenient in accepting markup that it
shouldn't, but overall it seems to work quite well.  It's available for
download at:

     http://xmlmodeling.com/examples/xhtml/

What's interesting about this is that the schema was automatically
generated from a UML model.  A white paper is available at the same
location that includes all UML class diagrams for the XHTML Basic modules.
I've written a schema generator that produces schemas from any UML tool
that can export an XMI 1.0 document representing the model.  This model of
XHTML was created using Rational Rose.

This model makes very heavy use of inheritance to capture the XHTML concept
of content groups, such as Flow, Block, Inline, etc.  I have generated two
different schemas: one uses extension of complexType definitions, the other
employs a copy-down strategy to avoid extension.  Both schemas work with
the XSV validator, but XML Spy only works with the non-extension version.
XML Spy produces an error from the other version that appears to be a bug
in that tool (it claims that <h1> does not allow text content, even though
it's defined as 'mixed').  My test document is also available for download.

All comments welcome!

Regards,
  Dave Carlson
  Ontogenics Corp.
  Boulder, Colorado
Received on Sunday, 4 March 2001 22:41:07 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:20 GMT