|
[XMLSCHEMA-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] [XML Schema 1.1] I need an example that illustrates the usefulness of xs:error
From: Costello, Roger L. <costello@mitre.org>
Date: Tue, 21 Jul 2009 15:56:59 -0400 To: "xmlschema-dev@w3.org" <xmlschema-dev@w3.org> Message-ID: <9E51F88D5247B648908850C35A3BBB5004009EEE20@IMCMBX3.MITRE.ORG> Hi Folks, Consider this usage of xs:error: <xs:element name="Publication" type="PublicationType"> <xs:alternative test="@kind eq 'magazine'" type="MagazineType" /> <xs:alternative test="@kind eq 'book'" type="BookType" /> <xs:alternative test="(@kind ne 'book') and (@kind ne 'magazine')" type="xs:error" /> </xs:element> It says that if an instance document has a Publication element with a kind attribute not equal to 'book' or 'magazine' then throw an error. But that doesn't illustrate the usefulness of xs:error because the same functionality can be accomplished by simply constraining @kind: <attribute name="kind"> <simpleType> <restriction base="string"> <enumeration value="book" /> <enumeration value="magazine" /> </restriction> </simpleType> </attribute> Can you provide an example that illustrates the usefulness of xs:error? /RogerReceived on Tuesday, 21 July 2009 19:57:35 GMT |
Subscribe in XML format
|

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




