[Home] [By Thread] [By Date] [Recent Entries]


Greetings,

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:complexType>
   <xsd:sequence>
      <xsd:choice>
      <!--
        <xsd:element ref="a" />
        <xsd:element ref="b" />
      -->
     <xsd:element name="a" type="aType"/>
     <xsd:element name="b" type="bType"/>
      </xsd:choice>
   </xsd:sequence>
  </xsd:complexType>
 </xsd:element>

The idea is still validate the XML example:

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

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.

regards,
Pedro Salazar.
-- 
/ps


Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member