Title: Are both of these valid for castor??

I have made a sample schema and 2 xml documents that represent that.
I have used XML-Spy and it says both are valid.

XML 1
-----
<BQuery Battr="xyz" xmlns="abstQuery">
  <C>String</C>
</BQuery>

XML 2
-----
<AQuery Battr="xyz" xsi:type="BQueryType" xmlns="abstQuery">
  <C>String</C>
</AQuery>

Using castor XML 1 passes but XML 2 fails saying:
   org.xml.sax.SAXException: unable to find FieldDescriptor for 'C' in ClassDescriptor of AQuery

I am using the castor from cvs with tag_0_9_3_18.
I hope that castor is able to support such schema representation or is this a bug.
All opinions are most welcome as I am going nuts over this problem.

Thanks,
Kamlesh

------------------------------ Schema --------------------------------
<schema targetNamespace="abstQuery" xmlns:a="abstQuery" xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="unqualified">

 
  <element name="C" type="string"/>

  <element name="AQuery" type="a:AQueryAbstractType"/>
  <complexType name="AQueryAbstractType" abstract="true"/>
       
  <element name="CQuery" type="a:CQueryAbstractType"/>
  <complexType name="CQueryAbstractType" abstract="true">
    <complexContent>
        <extension base="a:AQueryAbstractType">
          <sequence>
            <element ref="a:C"/>
          </sequence>
        </extension>
    </complexContent>
  </complexType>
       
  <element name="BQuery" type="a:BQueryType"/>
  <complexType name="BQueryType">
    <complexContent>
        <extension base="a:CQueryAbstractType">
          <attribute name="Battr" type="string"/>
        </extension>
    </complexContent>
  </complexType>

</schema>

Reply via email to