W3C home > Mailing lists > Public > xmlschema-dev@w3.org > February 2003

substitutionGroup and anyType

From: Hugh Wallis <hugh_wallis@hyperion.com>
Date: Wed, 12 Feb 2003 11:38:13 -0500
Message-ID: <026301c2d2b5$22f59ab0$2702a8c0@hyperion.com>
To: <xmlschema-dev@w3.org>
With this schema (called AnyType.xsd):

<?xml version="1.0" encoding="UTF-8"?>

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">

     <xs:element name="item" type="xs:anyType" abstract="true"/>

     <xs:element name="library" type="xs:string" substitutionGroup="item"/>

</xs:schema>

this file

<?xml version="1.0" encoding="UTF-8"?>

<library xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="AnyType.xsd">

Text

</library>



Validates fine in XML-Spy, Topologi Schematron Validator (uses MSXML 4.0), using JAXP/Xerces2 but not using .NET validator which gives the error message 



    'library' cannot be a member of the substitution group with head element 'item'. An error occurred at file:///C:/temp/AnyType.xsd(4,2)



Which is right?



Thanks



Hugh Wallis
Received on Wednesday, 12 February 2003 11:38:49 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:36 GMT