Hi,

I have an XSD which has a attribute like below -
<xsd:attribute name="field_id" type="xsd:unsignedByte" use="optional"/>

Now in my sample test.xml I have value of "151" or "155" for this attribute
field_id.

I have written the below piece of code to read the test.xml and convert it
to the java object. But when I run the program it gives me an error due to
this value of 151 for the field_id attribute as shown below:

Is this a bug or a known issue, because as per XSD types definition,
xsd:unsignedByte has valid values between 0 - 255.

Any suggested workarounds???

-----------------------------------------------------------
Exception in thread "main" java.lang.NumberFormatException: Value out of
range. Value:"151" Radix:10
at java.lang.Byte.parseByte(Unknown Source)
at java.lang.Byte.<init>(Unknown Source)
at
com.oob.schema.gen.JiBX_bindingMungeAdapter.JiBX_binding_unmarshalAttr_1_4()
at com.oob.schema.gen.JiBX_bindingMungeAdapter.JiBX_binding_unmarshal_1_5()
at com.oob.schema.gen.JiBX_bindingMungeAdapter.JiBX_binding_unmarshal_1_20()
at com.oob.schema.gen.JiBX_bindingMungeAdapter.JiBX_binding_unmarshal_1_44()
at com.oob.schema.gen.JiBX_bindingMungeAdapter.JiBX_binding_unmarshal_1_45()
at com.oob.schema.gen.JiBX_bindingMungeAdapter.JiBX_binding_unmarshal_1_46()
at com.oob.schema.gen.JiBX_bindingCboSchemaType_access.unmarshal()
at
org.jibx.runtime.impl.UnmarshallingContext.unmarshalElement(UnmarshallingContext.java:2757)
at
org.jibx.runtime.impl.UnmarshallingContext.unmarshalDocument(UnmarshallingContext.java:2900)
at com.test.TestMgr.main(TestMgr.java:24)
-----------------------------------------------------------------------



-- 
*Best Regards,*
*Vipul Bahuguna*
*Life is an experience ... enjoy it!*
*My Blog: http://vipulbahuguna.blogspot.com
<http://vipulbahuguna.blogspot.com/>*
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their 
applications. Written by three acclaimed leaders in the field, 
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to