XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
RE: [xml-dev] What is the "market share" of Relax NG vs XSD schema ?

I agree with everything Mike says.  Furthermore, while it's true that 
RelaxNG is the simpler, cleaner, and in certain dimensions more powerful 
language, and with a nicer syntax, one can make the case that XSD has 
technical advantages for certain scenarios as well.  There is a tradeoff 
between building languages in which the parse is deterministic (XSD) vs. 
non-deterministic (RelaxNG).  RelaxNG, for example, has a very nice story 
about closure under intersection/union/difference:  you can always write a 
RelaxNG schema that accepts just exactly what is accepted by any two other 
RNG schemas, what's accepted by either of them, etc.  XSD can't in general 
do the equivalent.  On the other hand, I would claim that XSD has a 
stronger story regarding type assignment, and it has a stronger story 
about static typing.  The XQuery language uses XSD as its type system. You 
can, for example, declare in XSD a type called "Measurement" that has 
calls for a decimal number as the element content, with an attribute 
specifying units such as "inches" or "cm".  You can use that type in your 
schema to declare elements named "Width" and "Height", which you can show 
in advance will always accept the same content.  Furthermore, you can 
define XQuery functions which return as their value a such a Measurement. 
It would be interesting to see how the XQuery language would change if 
RelaxNG were used as the base typing system.  I'm not saying the results 
would be bad, but I'm fairly sure they would be different.  For similar 
reasons, I think you can make the case that XSD has a stronger story about 
databinding, particular binding into systems that themselves are 
statically typed.  The obvious binding of the above example to Java or 
.Net is a class called "Measurements", and member variables called "width" 
and "height".  Because the to variables are of the same type, they are 
assignment compatible:  you can write width=height; and it will work.  You 
can do Java and .Net databinding with RelaxNG, but I think it works best 
with a deterministic subset of the language, and I think it's fair to say 
that RelaxNG doesn't give as much attention to facilitating the assignment 
of compatible types in examples like this.

So, in addition to all the factors that Mike lists, I think there are 
non-trivial technical tradeoffs.  Some of them do strongly favor RelaxNG 
for many purposes, but XSD has some technical strengths as well, and some 
of those are exploited by systems like XQuery and by various databinding 
frameworks.   (I should say, for those who don't know me, that I was 
involved to a significant degree with the design of XSD.  I've tried to 
make the above a balanced analysis, but it's certainly possible that 
reasonable people would see things differently.)

Noah

--------------------------------------
Noah Mendelsohn 
IBM Corporation
One Rogers Street
Cambridge, MA 02142
1-617-693-4036
--------------------------------------








"Michael Kay" <mike@saxonica.com>
04/09/2008 05:22 AM
 
        To:     "'Ben Stover'" <bxstover@yahoo.co.uk>, "'xml-dev'" 
<xml-dev@lists.xml.org>
        cc:     (bcc: Noah Mendelsohn/Cambridge/IBM)
        Subject:        RE: [xml-dev] What is the "market share" of Relax 
NG vs XSD schema ?


> 
> Why is Relax NG not becoming popular?
> Looking at its properties and advantages over XSD it should 
> become the one and only schema defintion language
> 

It's an old story. Why did the Dvorak keyboard not become popular? Why
aren't we all using Macs? Why do we use ludicrously insecure email 
protocols
that flood the world with spam, when we could have adopted X.400? 
Technical
quality was never enough to ensure success; the world will not beat a path
to your door just because you have a better mousetrap.

When it comes to standards adoption, most people will not adopt X unless
they believe that everyone else will adopt X. So success depends on having 
a
convincing endorsement from organizations that have the reputation to 
either
predict the future or create it. Relax NG has never had that endorsement.
(And indeed, ISO doesn't have that reputation.)

Michael Kay
http://www.saxonica.com/


_______________________________________________________________________

XML-DEV is a publicly archived, unmoderated list hosted by OASIS
to support XML implementation and development. To minimize
spam in the archives, you must subscribe before posting.

[Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
Or unsubscribe: xml-dev-unsubscribe@lists.xml.org
subscribe: xml-dev-subscribe@lists.xml.org
List archive: http://lists.xml.org/archives/xml-dev/
List Guidelines: http://www.oasis-open.org/maillists/guidelines.php





[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS