• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSXMLDocument and XSD substitutionGroup
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Re: Strange leak reported by leaks command line tool
  • Next by Date: Re: Convert CGImageRef from BGR to RGB
  • Previous by thread: Re: opening default email and browser from the code
  • Next by thread: Re: Convert CGImageRef from BGR to RGB
  • Index(es):
    • Date
    • Thread