I just read Choose RELAX Now (Tim Bray) and RELAX NG Wins (Elliotte Rusty Harold) and spent today learning more about RELAX NG.
Some Background
To give some perspective on the length of my involvement with XML and defining schemas: I was working with XML in one of its earliest uses at Microsoft. In 1997 we were using XML (as it existed) & the WebDAV protocol to provide access to content in the Exchange Server store. Now you know why my name appears in the acknowledgements section of RFC2581.
My typical encounter with XSD involves its presence functional specifications at Microsoft. Without going into a full accounting of every event: the common end result is that it was hard to read, hard to understand, hard to learn, and hard to communicate with. I maintain that specs should be understandable. (For what meaning is a reader's feedback if he didnt understand what the author intended to express?) In my experience, XSD simply didn't contribute to understandability.
Let's Compare
Here's an XSD example taken from Wikipedia:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="country" type="Country"/> <xs:complexType name="Country"> <xs:sequence> <xs:element name="name" type="xs:string"/> <xs:element name="population" type="xs:decimal"/> </xs:sequence> </xs:complexType> </xs:schema>
Here's a RELAX NG schema (using its compact syntax) for something similar:
element Country{ element name { text }, element population { xsd:int } }
I am going adopt RELAX NG
This means three things:
Final thoughts
Additional Resources