- Developer Tools
Eric Promislow, February 23, 2006
So maybe dentists know more about the gum-chewing habits of their patients than how they prefer to create their XML documents. But a few of us here were discussing whether Relax NG has made headway against XML Schema. I have...
So maybe dentists know more about the gum-chewing habits of their patients than how they prefer to create their XML documents. But a few of us here were discussing whether Relax NG has made headway against XML Schema.
I have too much SGML experience to be much of a fan of XML Schema as a data-definition language. In most cases, the description files are harder for humans to create and understand than those old DTDs, and even the argument that it's easier for machines to process them doesn't hold much water. To process a DTD you needed a true lexical analyzer and parser to handle gotchas like parameter entities, comments, and strings. XML Schema instances might be easier to lex and parse, but you need a symbol table to handle its type system.
Many of us at ActiveState like Relax NG, and we use the XML-based "full syntax" form for ease of processing in some of our products and systems. These documents are straightforward to create, read, maintain, and process.
So I was asked which was more popular, and I resorted to that standby, the Google search. I figured it would be sufficient to treat the respective namespace URIs for RelaxNG and XML Schema as markers in published custom schemas. In other words, if someone had developed their own schema and was using it to publish XML documents on the web, they would need to publish the schema as well, and Google would pick it up. Neither of these strings was needed in the instances, just in the schema definition files, so I wouldn't be counting the number of documents created against a certain schema, just the actual schemas.
I had to repeat the queries several times, as the results were fully unexpected, but I always got this answer:
Results 1 - 10 of about 13,900 for 'http://relaxng.org/ns/structure/1.0'
Results 1 - 10 of about 586 for 'http://www.w3.org/2001/XMLSchema'
Even without trying to detect instances of the compact, equivalent, non-XML syntax for RelaxNG, this suggests that people creating their own XML schemas for documents (which are more likely to be published via the web than database rows), are almost 25 times more likely to use Relax NG than XML Schema.
My guess is that the people who used to write DTDs for SGML documents have happily adopted Relax NG, while XML Schema has found a home for more data-intensive applications, such as the data-description component of SOAP's WSDL.
Subscribe to ActiveState Blogs by Email
Share this post:
Category: dynamic languages