The Best Way to Validate XML Document Structures
RELAX NG won’t solve all issues by itself. It isn’t designed to solve every conceivable validation problem. RELAX NG is, however, designed to be the best tool to solve two key pieces of the problem: validating the structure of XML document and providing a connection to datatype libraries that validate the content of text nodes and attributes. It’s also designed to be used as a part of the ISO DSDL framework, which deals with the larger issues surrounding validation. (DSDL is described in Appendix A).
This tight focus makes RELAX NG very different from its main rival, W3C XML Schema. One of the reasons for the complexity of W3C XML Schema is that it includes many features that have been kept out of RELAX NG. W3C XML Schema cares not only about validating the structure of XML documents, but also about validating the content of text nodes and attributes and checking the integrity between keys and references. More importantly, W3C XML Schema addresses many issues beyond validation. It attempts to be a modeling language that can classify the elements and attributes of XML documents, identify their semantics, use these semantics as extensible object-like models, and perform automatic binding between XML documents and objects. All these goals are admirable, but too many of them are stuffed into a single technology.
During the development of RELAX NG, XML structure validation remained the focus. No compromises were made in deference to other ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access