Re: [xml] Schema validation fails with global definitions

On Thu, Apr 08, 2004 at 03:48:37PM +0200, Israel Ganor wrote:
Validating this simple file using xmlSchemaValidateDoc() (Windows libxml
2.6.7) always gives the error "Element USER content check failure":

<BHUB-ADMIN xmlns:xsi="";
      <USER ACTION="modify">

The schema fragment looks as follows:
<xs:element name="BHUB-ADMIN">
                      <xs:element ref="USER"/>
<xs:element name="METHODS" type="xs:byte"/>
<xs:element name="USER">
                      <xs:element ref="METHODS"/>
              <xs:attribute name="ACTION"/>

Te error is resolved if I replace the global definition of USER (<xs:element
ref="USER"/>) by a local definition as follows:

Doesn't libxml2 support global elements?
This is a great problem for me since I have huge schemas with complex
hierarchy, and many of the elements are common and referenced from several

  I can't really make sense of a "schemas fragment". It seems to me
this should work, but since you didn't provided a complete example 
I can't really reproduce the problem. Can you post the full xsd (or 
a reduced version of it rather).


Daniel Veillard      | Red Hat Network
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]