[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: Costello, Roger L. <costello@mitre.org>
Date: Wed, 22 Jul 2009 13:57:55 -0400
To: "xmlschema-dev@w3.org" <xmlschema-dev@w3.org>
Message-ID: <9E51F88D5247B648908850C35A3BBB50040206319B@IMCMBX3.MITRE.ORG>
RE: [XML Schema 1.1] I need an example that illustrates the  usefulness  of xs:error
Hi Michael,

> A schema for XSLT, for example, might enforce a rule that
> XSLT templates must have either a name or a match attribute
> by declaring the xsd:template element thus:
> 
>    <element name="template">
>      <alternative test="@name" type="xslt:named-template"/>
>      <alternative test="@match" type="xslt:template"/>
>      <alternative type="xsd:error"/>
>    </element>

Doesn't this achieve the same result (I simply omitted the third alternative):

   <element name="template">
     <alternative test="@name" type="xslt:named-template"/>
     <alternative test="@match" type="xslt:template"/>
   </element>

In this version an error is generated if there is neither a name attribute or a match attribute.

I like this one:

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

Thanks.

/Roger
Received on Wednesday, 22 July 2009 17:58:32 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.