Friday, August 29, 2003

A Compact Syntax for W3C XML Schema

The article A Compact Syntax for W3C XML Schema on by Erik Wilde presents an interesting alternative to the verbose W3C XML Schema while preserving the same semantic.
Here's an example from the article to give you an idea:

W3C Schema fragment:
<xs:element name="complexContent" id="complexContent">

<xs:extension base="xs:annotated">
<xs:element name="restriction" type="xs:complexRestrictionType"/>

<xs:element name="extension" type="xs:extensionType"/>
<xs:attribute name="mixed" type="xs:boolean"/>

XSCS (XML Schema Compact Syntax):
element complexContent extends xs:annotated {

( restriction { xs:complexRestrictionType } | extension { xs:extensionType } )
attribute \mixed { xs:boolean } }

That's definitely less verbose although I don't know if I like the curly bracket and the backslash that much ;-)

No comments: