RELAX Wins
Among the XML cognoscenti, the debate is effectively over. Everyone is choosing RELAX NG as their schema language, and compiling to DTDs or W3C XML Schemas as necessary. I don’t know of a single project in the last couple of years that considered both RELAX NG and W3C Schemas and chose to go with the latter. Certainly, there’ve been a lot of W3C Schema adoptions. However those seem to have been made mostly by people who didn’t know they had a choice. In particular, the W3C imprimatur seems very appealing to larger, more bureaucratic organizations such as government agencies.
With that in mind, I thought it might be useful to list some of the groups (including some of the W3C’s own working groups) who have chosen to do their work in RELAX NG:
-
and many more…
Finally libxml, Linux’s standard XML parser, includes full support for RELAX NG, but only partial and incomplete support for W3C schemas.
That’s a pretty impressive list, but if the fact that all the cool kids are trying it isn’t enough to get you to take a hit (government bureaucrats aren’t known for being all that hip to the cool kids anyway) then maybe this will. RELAX NG is now an official ISO Standard, ISO/IEC 19757, Part 2. For people and governments who care about such things, ISO documents are real standards. W3C “recommendations” are also-rans.
Try RELAX NG. I promise it will relieve the stress caused by schemas.
November 26th, 2006 at 7:09 pm
Atom’s on that list of projects, too.
November 27th, 2006 at 11:03 am
I was just about to point out the fact myself, Aristotle. 🙂
November 27th, 2006 at 10:27 pm
[…] Elliotte caught my attention with this: I don’t know of a single project in the last couple of years that considered both RELAX NG and W3C Schemas and chose to go with the latter. Certainly, there’ve been a lot of W3C Schema adoptions. However those seem to have been made mostly by people who didn’t know they had a choice. In particular, the W3C imprimatur seems very appealing to larger, more bureaucratic organizations such as government agencies. […]
November 27th, 2006 at 10:35 pm
Well said and true. It could mean some serious rework for some organizations, but it will be worth it.
At least the web technologists are finally coming to the level of maturity that they look at the quality of the work, not the brand or the names on the cover, and if the work makes them queasy, they feel that they can look around to other sources.
That is competition. It is a healthy means. It has never been the case that the ‘web’ is a seamlessly interoperating system. It never will be and that is a good thing because the day that it is is the day it quits breathing.
len
November 27th, 2006 at 11:18 pm
The default for both SOAP based services and data binding frameworks is still XMLSchema which i believe form a much larger percentage of XML usage. Its very unlikely that this will change in the near future. Declaring victory is premature though it would be nice to see RELAX usage pick up more.
Is XML by your definition an also ran and not a standard :-)?
November 28th, 2006 at 1:23 am
I brought up the issue of RelaxNG at a Chris Sells conference about two years ago. The conference was for the most part a Microsoft love fest, but it was very interesting that about the only ones that the I found that were actually enamored of XSD where the WS* types that had already bought into the full WS-stack, of which XSD was a key (underlying) component. There were quite a few people there that were actually even then raising significant questions about the viability of XSD and the easier and generally far more well-thought out approach that RelaxNG engenders.
The problems with XSD were brought home to me again recently with a medical systems application that I’m writing, something that’s heavily XML based. Certain aspects, such as XSLT 2.0 and to a lesser extent XQuery seem to work remarkably well, and for all its warts I’ve become a hard-core XForms addict. Yet when I had to go to XSD for a schema language, I was reminded again about all the problems that XSD has and all the places where it is dangerously ambiguous or just difficult to work with. I’ll probably wrap up the current round of development in XSD, but getting RelaxNG versions of my schema are definitely on my list of things to do once we hit round 2.
— Kurt
November 28th, 2006 at 3:29 am
My first question was going to be, “toolkit support?” But that was answered in the reference to libxml. Perhaps the RelaxNG evangelists could talk this up more. From my perspective, tool support is at least as important as any other single aspect; I can learn and write RelaxNG to my heart’s content, but without the ability to actually utilize it on a component level, well…
November 28th, 2006 at 12:11 pm
This is true enough for document validation and processing maybe. But for the data world I don’t think the same advantages apply. everyone that talks up Relax NG tends to be talking about XSLT, XQuery, XHTML etc… not really talking about SOA and data modelling.
November 28th, 2006 at 12:29 pm
I agree that RelaxNG is far better – in particular, more intuitive – than XML Schema.
One particular problems I’ve had with it is that you can’t specify cardinalities – e.g. up to 256 occurrences.
Anyone else come across this sort of problem?
November 28th, 2006 at 12:34 pm
You can add TEI (P5 release) to your list as well…
November 28th, 2006 at 6:07 pm
As somebody who’s only looked seriously at W3C XML schema thus far, can you explain what Relax NG has that Schema hasn’t? Or. what misfeatures it lacks?
November 28th, 2006 at 6:25 pm
[…] He’s referring to Tim Bray who writes: Choose RELAX Now · Elliotte Rusty Harold’s RELAX Wins may be a milestone in the life of XML. Everybody who actually touches the technology has known the truth for years, and it’s time to stop sweeping it under the rug. W3C XML Schemas (XSD) suck. They are hard to read, hard to write, hard to understand, have interoperability problems, and are unable to describe lots of things you want to do all the time in XML. Schemas based on Relax NG, also known as ISO Standard 19757, are easy to write, easy to read, are backed by a rigorous formalism for interoperability, and can describe immensely more different XML constructs. To Elliotte’s list of important XML applications that are RELAX-based, I’d add the Atom Syndication Format and, pretty soon now, the Atom Publishing Protocol. It’s a pity; when XSD came out people thought that since it came from the W3C, same as XML, it must be the way to go, and it got baked into a bunch of other technology before anyone really had a chance to think it over. So now lots of people say “Well, yeah, it sucks, but we’re stuck with it.†Wrong! The time has come to declare it a worthy but failed experiment, tear down the shaky towers with XSD in their foundation, and start using RELAX for all significant XML work. [Update: Piling-on are Don Park, Gabe Wachob, Mike Hostetler and some commenters. There’s thoughtful input from Dare Obasanjo, and now the comments have some push-back too.] [4 comments] Actually Eliotte’s post was short and unemotional – other than the title. Here’s most of it: Among the XML cognoscenti, the debate is effectively over. Everyone is choosing RELAX NG as their schema language, and compiling to DTDs or W3C XML Schemas as necessary. I don’t know of a single project in the last couple of years that considered both RELAX NG and W3C Schemas and chose to go with the latter. Certainly, there’ve been a lot of W3C Schema adoptions. However those seem to have been made mostly by people who didn’t know they had a choice. In particular, the W3C imprimatur seems very appealing to larger, more bureaucratic organizations such as government agencies. (So it’s the title, and Elliotte’s standing, that have convinced the world) Some of the XML-DEVers are less than convinced – their argument is that paying customers in large companies don’t care how awful the technology is as long as it’s seen to be standard. W3C XSD will survive and prosper simply because it’s there, tooled up, and supported by the 800lb gorillas. I give myself a little pat on the back for having taken this anti-XSD stance ( SOAP of the evening, beau…tiful SOAP) a few days ago. Given the choice I would never have developed CML in XSD. Why did I do it? Because it was then (and perhaps still is) the mainstream way to do XML, where we can expect tools from professional developers. Like Xerces – yes, I’m still going to blog Xerces some time… It’s difficult enought to persuade chemists to be interested in anything in this area, and by using minority approaches more would be turned off – and I’ve had people who would not have looked at CML unless it was XSD-based. However things have changed. Every part of the XML/Web world that I interact with is boiling with change. We have finally admitted that there is a better way. Perhaps it will even reach the gorillas – after all they adopted SAX – and you can’t get much simpler than that. […]
November 29th, 2006 at 2:02 am
[…] Take a deep breath and relax. Maybe in your future there won’t be any XSD, only Relax NG. […]
November 29th, 2006 at 7:47 am
I’ve been pushing the dreadful day when I had to learn XSD further and further into the future. Now I’ll never need to! Woohoo!
If you ignore a technology for long enough, it will die…
November 29th, 2006 at 10:29 am
[…] It seems that all the great minds of the XML world are declaring that W3C XML Schemas (XSD) are dead, and everyone is going to switch to Relax-NG. Cf. Elliotte Rusty Harold and Tim Bray. However I think a lot of us who live in the corporate world are going to be using XSD for a long time. […]
November 29th, 2006 at 4:35 pm
I’m afraid I don’t agree with the assertion that RELAX wins over schema. My argument is here: http://drmacros-xml-rants.blogspot.com/2006/11/relax-wins-not-so-fast.html
November 30th, 2006 at 7:15 am
[…] RELAX Wins (tags: XML relaxng schema xsd standards by:elliotte_rusty_harold) […]
December 5th, 2006 at 6:24 am
[…] Proponents of RELAX NG – which stands for REgular LAnguage for XML Next Generation – point out that it is already a recognised ISO Standard: ISO/IEC 19757, Part 2. […]
December 5th, 2006 at 9:28 am
[…] And now, it appears the tide is turning. I couldn’t be happier. Though I want back all the wasted time and effort XML Schema foisted upon us. […]
December 5th, 2006 at 10:11 am
[…] Proponents of RELAX NG – which stands for REgular LAnguage for XML Next Generation – point out that it is already a recognised ISO Standard: ISO/IEC 19757, Part 2. […]
December 5th, 2006 at 6:01 pm
I continue to appreciate the good work that has been done on RELAX and the enlightened discussions of folks on xml-dev.
However, I also continue to be dismayed by how far from reality a lot of this stuff is. “I don’t know of a single project in the last couple of years that considered both RELAX NG and W3C Schemas and chose to go with the latter”. I would counter with: I don’t know a single project in the last years that I have seen out in industry that _has considered RELAX_!
As Joe72 rightly points out, people are using XML Schema for data modeling. It does happen to make a good data model, with some caveats, if you have good tool support.
And as for Len’s comment above, “It could mean some serious rework for some organizations, but it will be worth it.”. I want to see how anybody stands up in front of a bottom line driven organisation and makes a believable business case how spending time converting to another schema language will make more money or cut costs, especially if all staff involved have to be retrained and recruiting is substantially complicated.
December 13th, 2006 at 1:08 am
[…] Surprisingly though, I’m not picking on any one particular validation technology. XML Schema has been getting its fair share of bad press, and rightly so, but for different reasons than we’re going to talk about here. We believe that virtually all forms of validation, as commonly practiced, are harmful; an anathema to use at Web scale. Specifically, our argument is this; Tests of validity which are a function of time make the independent evolution of software problematic. […]
December 13th, 2006 at 11:49 pm
[…] Tim Bray – Every time I’ve looked at an XSD for describing an XML schema, I’ve felt repelled, as if by a millimeter wave weapon. Tim Bray, and Eliotte Rusty Harold, and others linked from Mr. Bray’s post, agree, that RELAX NG is a better schema description language. Slashdot discussion. [/.] […]
December 18th, 2006 at 8:09 am
XML Schemas should never have been invented, they are the products of lesser souls who are frightened by the power of XML.
However, RelaxNG is not perfect to my mind either.
That is why I have published http://tobe.homelinux.net/xis as an attempt to create an even more useful way of defining XML information models. Sorely needs peer review, though.
Anyone wish to contact me about this, please do at my.name at gmail.com (leave out the dots on the o)
December 22nd, 2006 at 5:46 am
[…] Surprisingly though, we’re not picking on any one particular validation technology. XML Schema has been getting its fair share of bad press, and rightly so, but for different reasons than we’re going to talk about here. We believe that virtually all forms of validation, as commonly practiced, are harmful; an anathema to use at Web scale.” […]
March 17th, 2007 at 3:38 am
Unfortunately, in general, there is a tendency in both the corporate and free software world to continue using a familiar language rather than learn a new (though better) language.
Otherwise Ada would have won out over (Ugh!) (C, C++, Java), etc long ago. IMHO, NO project starting or undergoing major rewrite should use any language than Ada.
Similarly, simple inertial will keep XSD alive for a long time.
Further, Relax NG depends on XSD for data content validation.
Further, the fixation of the 800# gorillas on this quarter profits over long range profits will contribute to this inertia.
March 17th, 2007 at 3:50 am
In the tool chain area, what would be lovely would be a plugin for ViM that would not only recognize well-formed XML (and mark stuff that is not well-formed) but could read, parse, and implement the schema that was supposed to be used to validate the schema.
In particular, both distinctive highlighting for invalid content (as well as failure to be well-formed XML) and a means to get context-sensitive choices for content would be extremely helpful and productivity enhancing.
It would turn ViM into a real XML editor!
Does anyone reading this know of such a plugin?
If so, please send a note to <tmu-hack at buzco dot nyct.net>.
May 2nd, 2008 at 11:01 am
[…] people have started to push back on the REST vs. WS-* and RELAX vs. W3C XSD and Rails vs. JEE fronts with a self-defeating argument. Well, of course, you’re right they […]
October 13th, 2015 at 3:11 pm
In practice, RELAX NG fails MISERABLY at interop. How do I use the validator.nu schemas with xmllint? Don’t even bother. They’re practically inseparable from the rest of the codebase. Meanwhile, using an XML Schema for the same purpose works flawlessly on the first attempt.
This is an actual, real world use-case, so please don’t give me the usual “you’re doing it wrong” bullshit. Relax NG is total garbage.
November 11th, 2019 at 6:20 pm
[…] the fact that it was authored by one of the foremost experts on markup languages and has the support of the digerati. If RelaxNG can’t topple Goliath, then woe to those that try to topple […]