You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xmlbeans-user@xml.apache.org by rm...@manu.com on 2004/05/07 21:21:10 UTC

using isNil()

I am getting the following exception when using isNil() on nillable 
elements. 

Exception in thread "main" 
com.bea.xbean.values.XmlValueOutOfRangeException
        at 
com.bea.xbean.values.JavaIntHolder.set_text(JavaIntHolder.java:36)
        at 
com.bea.xbean.values.XmlObjectBase.update_from_wscanon_text(XmlObject
Base.java:1003)
        at 
com.bea.xbean.values.XmlObjectBase.check_dated(XmlObjectBase.java:113
3)
        at 
com.bea.xbean.values.XmlObjectBase.isNil(XmlObjectBase.java:487)
        at com.easypo.impl.XmlLineItemBeanImpl.isNilTestint(Unknown 
Source)
        at client.POHandler.printItems(POHandler.java:71)
        at client.POHandler.main(POHandler.java:96)


The XSD I am using is 

<xs:complexType name="line-item">
                <xs:sequence>
                        <xs:element name="description" type="xs:string"/>
                        <xs:element name="per-unit-ounces" type="xs:decimal"/>
                        <xs:element name="price" type="xs:decimal"/>
                        <xs:element name="quantity" type="xs:integer"/>
                        <xs:element name="testint" type="xs:int" nillable="true"/>
                </xs:sequence>
</xs:complexType>

The XML I am using is 

<po:line-item>
                <po:description>Burnham's Celestial Handbook, Vol 1</po:description>
                <po:per-unit-ounces>5</po:per-unit-ounces>
                <po:price>21.79</po:price>
                <po:quantity>2</po:quantity>
                <po:testint xsi:nil="true"/>
</po:line-item>

I would like to check whether 'testint' is null and proceed. Is there 
anything I am missing or is there a workaround for this?

Thanks

Rao Madhavaram
Manugistics Inc