|
[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> 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. /RogerReceived on Wednesday, 22 July 2009 17:58:32 GMT |
Subscribe in XML format
|

![RE: [XML Schema 1.1] I need an example that illustrates the usefulness of xs:error](/images/get_stylus.gif)




