OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help



   Re: [xml-dev] schema: error validation depending on global orlocal eleme

[ Lists Home | Date Index | Thread Index ]


I intend to correct my schema from my original post. 

The elements 'operation' and 'transaction' should be replaced by 'a' and
'b' (this happened due a translation of my real case to a generic a
simplified case). 

The fixed version:

     <xsd:element name="a" type="aType"/>
     <xsd:element name="b" type="bType"/>
 <xsd:element name="test">
        <xsd:element ref="a" />
        <xsd:element ref="b" />
     <xsd:element name="a" type="aType"/>
     <xsd:element name="b" type="bType"/>

The idea is still validate the XML example:

        <a/> <b/> <a/>

which is reporting this error:

error:cvc-complex-type.2.4.a: Invalid content starting with element 'a'.
The content must match '((("":a)|("":b)))

But if I replace my local elements declarations, a and b, and use the
declaration by ref (using the commented code) it works fine.

Pedro Salazar.


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS