Re: DOMDocument::schemaValidate() - group nodes inside choice nodes

[email protected] ("nick eby") Thu, 11 Nov 2004 15:18:51 -0800
Newsgroups php.xml.dev
Message-ID <[email protected]>
the problem really wasn't that half-line ending with 'ref=" ' (i promise :)
that was a typo...
fixed below....

"Nick Eby" <[email protected]> wrote in message
news:[email protected]...
> 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>