[xsd-users] XSD 3.3.0 possible error when using type xsd:hexBinary with default value

Boris Kolpackov boris at codesynthesis.com
Fri Jul 20 08:46:40 EDT 2012


Hi Emil,

Meng, Emil <emeng at qualcomm.com> writes:

> We have been trying to use xsd 3.3.0 and have run into some issues with our
> schema where 3.2.0 works without problems. After debugging the issue, we
> found what seems to be an error in the code generated in 3.3.0 under certain
> conditions. So far, we see the problem when the following conditions are
> true:
> 
> 1. An element where Restrictions/enums are used, and there are greater 
>    than 9 entries
> 2. An element contains type xsd:hexBinary, and a default value exists (we're
>    using 01ffff, unknown if other values cause the problem, but without a
>    default value, things work fine)

Bizarre-looking bug with a very simple explanation. Took me some time to
figure out what's going on. A good one ;-).

What happens is we forget to restore the decimal format on the stream
after writing out some hex values (the hexBinary default value). Later,
in a completely unrelated type, we try to write a literal 10 integer
which ends up being written as 'a'.

In any case, I've fixed this for the next release of XSD. If you would
like, I can build you a pre-release binary with the fix. Just let me
knew which platform you need.

And thanks for reporting this and providing the test case!

Boris



More information about the xsd-users mailing list