[xsd-users] HexBinary

Boris Kolpackov boris at codesynthesis.com
Mon Dec 16 11:53:30 EST 2013


Hi Gene,

Falendysz, Gene <Gene.Falendysz at itron.com> writes:

> Is there a way to suppress the leading "0"s in HexBinary? I am working
> to a spec that requires an even number of digits and at most one leading 
> "0".

Strange spec. What if there are two leading zero bytes in the binary
representation. Are they just discaded?

In any case, you can customize the built-in xml_schema::hex_binary
type and implement your own encoding.

For more information on type customization see the C++/Tree Mapping
Customization Guide:

http://wiki.codesynthesis.com/Tree/Customization_guide

As well as the examples in the examples/cxx/tree/custom/ directory.
The example that is the closest to what you want to do would probably
be 'double'.

Boris



More information about the xsd-users mailing list