W3C home > Mailing lists > Public > xmlschema-dev@w3.org > October 2007

Re: optional, but at least one required

From: <noah_mendelsohn@us.ibm.com>
Date: Tue, 16 Oct 2007 19:21:51 -0400
To: "Marie Bilde Rasmussen" <mariebilderas@gmail.com>
Cc: "Pete Cordell" <petexmldev@tech-know-ware.com>, "Virginia Wiswell" <vwiswell@verizon.net>, xmlschema-dev@w3.org
Message-ID: <OF3F352950.7E6ED6EE-ON85257376.007F5D3C-85257376.0080255B@lotus.com>

Marie Bilde Rasmussen writes:

> I guess some of you will now tell me to use Relax NG instead. 
> Unfortunatley, I don't have that option. So I am not asking for
> an answer or solution,  I would just like to hear some opinions
> on the issues. 

If you're asking: "why did W3C XML Schema adopt the UPA constraint?", I 
can tell you that it was and remains a very contentious issue.  At the 
risk of oversimplifying or perhaps entirely mangling the analysis, some of 
the pros and cons are:

UPA "Advantages": 
a) makes it easier for database-mapping, programming language binding, 
user-interface generation tools, etc. to statically determine what a 
schema will and won't accept.  In certain respects, UPA restricts schemas 
to things that are relatively easier to bind than what you get without 
b) makes it easier to apply the deterministic validation algorithms, such 
as those that were used in many XML 1.0 validators

UPA "Disadvantages"
a) as you've seen, makes certain schemas impossible to write, and some 
others difficult to write in a straightforward way
b) confusing to users
c) Technologies like RelaxNG are closed under intersection, union and 
difference.  E.g. you can always write a schema that accepts exactly the 
union of the documents accepted by 2 or more other schemas.  I'm not 100% 
sure, but I'm fairly confident that adopting UPA is at odds with achieving 
such closure.  Closure is desirable for many reasons.  Most obviously, if 
you do a query to retrieve two classes of documents, conforming to S1 and 
S2 respectively, then closure ensures that you can write a schema that 
tightly bounds the results of the query.
d) Seems ugly to some people

As I say, I've probably missed some important points, but it does remain a 
point of active debate.  (BTW: don't infer from the length of the above 
lists that I'm against UPA;  I've been in favor of it, and it's 
sufficiently important to our database implementors among others that I 
remain in favor.  I'm just trying to present the pros and cons as I 
understand them.  I do think it's in some ways a tough call.)


Noah Mendelsohn 
IBM Corporation
One Rogers Street
Cambridge, MA 02142
Received on Tuesday, 16 October 2007 23:20:32 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:15:44 UTC