You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by "dr.jeff" <jl...@systechnologies.com> on 2008/07/02 01:25:55 UTC

complexContent extending simpleType breaks XmlBeans 2.2, 2.3

Here is DecimalType, which is a complexType with simpleContent that extends a
simpleType, xs:decimal: 

<xs:complexType name="DecimalType">
  <xs:simpleContent>
    <xs:extension base="xs:decimal">
      <xs:attribute ref="xs:decimal">
      </xs:attribute>
    </xs:extension>
  </xs:simpleContent>
</xs:complexType>

Here is AngleMeasureType, which is a complexType with complexContent that
extends DecimalType by adding another attribute: 

<xs:complexType name="AngleMeasureType">
  <xs:complexContent>
    <xs:extension base="tns:DecimalType">
      <xs:attribute name="angleUOM" type="xs:string">
      </xs:attribute>
    </xs:extension>
  </xs:complexContent>
</xs:complexType>

 

This process of changing from simpleContent (in DecimalType) to
complexContent (in AngleMeasureType), while only adding attributes to the
content, breaks the XmlBeans schema type system. 

This has been tested with XmlBeans versions 2.2 and 2.3. 

The resolution is to change AngleMeasureType to have simpleContent, as
follows: 

<xs:complexType name="AngleMeasureType">
  <xs:simpleContent>
    <xs:extension base="tns:DecimalType">
      <xs:attribute name="angleUOM" type="xs:string">
      </xs:attribute>
    </xs:extension>
  </xs:simpleContent>
</xs:complexType>

The error appears when calling xobj.validate(), or with the xsb dumper:

Unknown simple type variety
Exception in thread "main" java.lang.IllegalStateException: Unknown simple
type variety
        at org.apache.xmlbeans.impl.tool.XsbDumper.error(XsbDumper.java:149)
        at
org.apache.xmlbeans.impl.tool.XsbDumper.dumpTypeFileData(XsbDumper.java:1009)


-- 
View this message in context: http://www.nabble.com/complexContent-extending-simpleType-breaks-XmlBeans-2.2%2C-2.3-tp18227371p18227371.html
Sent from the Xml Beans - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org