Hi all,
I am working with XSD for a while using C# objects (
XmlSchemaCollec tion , XmlValidatingRe ader) and have met this
problem:
Current code demonstrates the problem:
<xs:schema ...>
<xs:element name="Parent" type="Parent_Ty pe" />
<xs:complexTy pe name="Parent_Ty pe">
<xs:all>
<xs:element name="Type" type="xs:string " maxOccurs="1" />
</xs:all>
</xs:complexType>
<xs:complexTy pe name="Child_Typ e">
<xs:complexCont ent>
<xs:extension base="Parent_Ty pe"/>
</xs:complexConte nt>
</xs:complexType>
<xs:element name="Child" substitutionGro up="Parent"
type="Child_Typ e" />
<xs:element name="Test">
<xs:complexType >
<xs:all>
<xs:element ref="Parent" minOccurs="0" />
<xs:element name="additiona lElement" type="xs:boolea n" />
</xs:all>
</xs:complexType>
</xs:element>
</xs:schema>
When loading the XSD to a XmlSchemaCollec tion object I get the
exception: System.InvalidC astException.
The most weird thing is that when I change the indicator to be
<xs:sequence> - it works fine (!)
And when I remove the object 'Child' it also works fine (!!!)
If I remove the 'additionalElem ent' it also works fine (!!!!!!)
What is wrong here? Could it be a bug?
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com