[XMLSCHEMA-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: [XML Schema 1.1] I need an example that illustrates the usefulness of xs:error

From: C. M. Sperberg-McQueen <cmsmcq@blackmesatech.com>
Date: Wed, 22 Jul 2009 11:51:01 -0600
Cc: "C. M. Sperberg-McQueen" <cmsmcq@blackmesatech.com>, "xmlschema-dev@w3.org" <xmlschema-dev@w3.org>
Message-Id: <CB6E9122-9098-4FD4-8B20-50129C367297@blackmesatech.com>
To: "Costello, Roger L." <costello@mitre.org>
Re: [XML Schema 1.1] I need an example that illustrates the  usefulness of xs:error
On 22 Jul 2009, at 05:37 , Costello, Roger L. wrote:

>
> Hi Mukul,
>
> Yesterday I was talking with a colleague and I described to him  
> Conditional Type Alternative (CTA) and then xs:error. He was puzzled  
> about xs:error. He couldn't see a legitimate (nonredundant) use case  
> for it. As I got to thinking about it, I agreed with him.

Just as discussions of regular expressions and regular
languages find it helpful to have a way to write down
an expression denoting the empty set, so also it can be
convenient, in thinking about document validation, to have
a name for a type with no valid instances.  I think
xsd:error would be a convenient thing to have even if
XSD 1.1 had not adopted conditional type assignment.

Consider a practical scenario (real example, names
suppressed to avoid distractions):  project P is working with
a local specialization of a large generic vocabulary V.
P uses all of the elements defined by V as required, and
some of the elements defined by V as optional.  Some
elements which are optional in V are optional in P,
some are required in P, and others are forbidden in P.

It is not enough for project P to tell its users "Don't
use element E" -- part of checking the acceptability of
documents for project P is checking that element E
does not occur at all, even though it's optional in
the base vocabulary V.

With some validation mechanisms, such as DTDs, it suffices
to provide a way to ensure that E is not declared.  But
if the validation language includes lax wildcards, that
won't be enough.  It would be convenient for project P
to be able to declare a simple restriction of vocabulary
V by writing

   <override schemaLocation="main.path.to.V">
     <element name="E" type="error"/>
     <!--* other elements can be excluded here by the same
         * method ... *-->
   </override>

And in XSD 1.1, that can be done.

-- 
****************************************************************
* C. M. Sperberg-McQueen, Black Mesa Technologies LLC
* http://www.blackmesatech.com
* http://cmsmcq.com/mib
* http://balisage.net
****************************************************************
Received on Wednesday, 22 July 2009 17:51:38 GMT

Subscribe to the Stylus Scoop newsletter for helpful XML tips and tutorials.
Email
First Name
Last Name
Company

Download Stylus Studio 6 XML Enterprise Edition

Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.