[1680783 views]

[]

Odi's astoundingly incomplete notes

New entries | Code

XML schema incompatibilities with Java

Some XML Schema (XSD) numeric data types are slightly incompatible with the Java language. While byte, short, int and long are defined the same size in the two typing systems (8, 16, 32 and 64 bits), XML schema offers unsigned counterparts too. The Java language still does not feature unsigned numeric types.
This means when a XSD defines a field as unsignedInteger you must use long in Java or you have to make sure the value never exceeds Integer.MAX_VALUE. XSD even has arbitrary size/precision numeric types like decimal or integer. You must choose the Java data type carfully depending on the application.


posted on 2006-05-09 14:45 UTC in Code | 0 comments | permalink