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

Meng, Emil emeng at qualcomm.com
Fri Jul 20 10:43:47 EDT 2012


Hi Boris,

Thanks so much for your quick response and the fix to the bug! I'm glad to hear that it was a relatively simple fix, certainly sounded like a fun one : ) We really appreciate it!

-emil

-----Original Message-----
From: Boris Kolpackov [mailto:boris at codesynthesis.com] 
Sent: Friday, July 20, 2012 6:47 AM
To: Meng, Emil
Cc: xsd-users at codesynthesis.com
Subject: Re: [xsd-users] XSD 3.3.0 possible error when using type xsd:hexBinary with default value

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