NSXMLDocument and XSD substitutionGroup
NSXMLDocument and XSD substitutionGroup
- Subject: NSXMLDocument and XSD substitutionGroup
- From: Thomas Castiglione <email@hidden>
- Date: Tue, 17 Jun 2008 12:02:30 +0800
Hi all,
I've been trying to use NSXMLDocument to validate stuff with an XML
Schema rather than a DTD, and have run into a problem. It doesn't seem
to be correctly implementing the substitutionGroup 'polymorphism'
aspect of XSD. The pattern goes like this:
-- in schema
<xs:element name="base" type="xs:string"/>
<xs:element name="firstSubtype" substitutionGroup="base"/>
<xs:element name="secondSubtype" substitutionGroup="base"/>
<xs:element name="container">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="base"/>
</xs:sequence>
</xs:complexType>
</xs:element>
-- in XML document
<container>
<base>Node of base type - this works</base>
<firstSubtype>Node of substituted type - this does not work</
firstSubtype>
</container>
If I have that firstSubtype element in there, NSXMLDocument init/
validation returns the error
"Element 'container' [CT local]: The element content is not valid."
Is this a bug/limitation of NSXML, or am I doing something wrong?
Thanks,
Thomas Castiglione
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden