xsl-list
[Top] [All Lists]

Re: [xsl] Issues with xs:error in the XPath 3.0 and XDM 3.0 Recommendations.

2014-04-19 21:38:43
On Sat, Apr 19, 2014 at 06:42:01PM -0700, Dimitre Novatchev scripsit:
To put it in other words:  Why was the xs:error type introduced (in
XML Schema)? What purpose does it serve? What problems does it solve?

http://lists.w3.org/Archives/Public/xmlschema-dev/2009Jul/0045.html (and
the rest of the thread) may be of interest.

xs:error would appear to be a result of conditional type assignment and
to allow

<element name="element" type="element">
     <alternative test="@name" type="localElement"/>
     <alternative test="@ref" type="elementRef"/>
     <alternative type="error"/>
</element>

as a way to define the schema "element" element, so that it must have a
name or a ref.  This is not something XSD 1.0 would allow.

There's also a case where you're using subset V of large shared
vocabulary P, and want to forbid element E in V when it is optional in P; 

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

That thread also has the cheerful acknowledgement that anything you can
do in XSD 1.1 with xs:error you can also do with assertions, but
xs:error is preferred for style and legibility.

-- Graydon

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--