Re: DOMDocument::schemaValidate() - group nodes inside choice nodes
| From: | nick eby | Date: | Thu, 11 Nov 2004 23:18:51 +0000 |
| Subject: | Re: DOMDocument::schemaValidate() - group nodes inside choice nodes | ||
| References: | 1 | Groups: | php.xml.dev |
| Request: | Send a blank email to php-xml-dev+get-501@lists.php.net to get a copy of this message | ||
the problem really wasn't that half-line ending with 'ref=" ' (i promise :)
that was a typo...
fixed below....
"Nick Eby" <neby@newedgenetworks.com> wrote in message
news:20041111230419.46195.qmail@pb1.pair.com...
> here's a simple schema and document that illustrates my problem- for the
> life of me i cannot see why this document is not valid against the schema.
> i simplified it a lot- i do need to use the group tag because
customer-info
> contains a lot more than just a name.
>
> DOMDocument::schemaValidate() method says this is invalid. BUT if i cut
the
> customer-info group and paste it over top of <xs:group
ref="customer-info"/>
> ... then everything is fine!?! now, this is a (big) stretch but- could it
> be a bug in schemaValidate()?
>
> Schema:
> <xs:schema
> xmlns:xs="http://www.w3.org/2001/XMLSchema">
> <xs:element name="customer">
> <xs:complexType>
> <xs:choice>
> <xs:element ref="customer-id"/>
> <xs:group ref="customer-info"/>
> </xs:choice>
> </xs:complexType>
> </xs:element>
>
> <xs:element name="customer-id" type="xs:long" />
>
> <xs:group name="customer-info">
> <xs:sequence>
> <xs:element ref="name" minOccurs="1"
> maxOccurs="1"/>
> </xs:sequence>
> </xs:group>
> </xs:schema>
>
> XML document:
> <customer>
> <name>Bob Eubanks</name>
> </customer>