[xsd-users] Double trouble

Boris Kolpackov boris at codesynthesis.com
Sun Jan 20 03:57:17 EST 2008


Hi Esben,

Esben Skovenborg <EsbenS at TCElectronic.com> writes:

> I think it would be most natural to map xsd:double to C++ double, as in
> your "even better solution", below. What would I need to do?

Ok, I've added the necessary support to the compiler. The pre-release
binary is here (I assumed you are using Windows):

http://www.codesynthesis.com/~boris/tmp/xsd-3.1.0.b2-i686-windows.zip

I've also create an example that shows how to re-map xsd:double and
xsd:decimal:

http://www.codesynthesis.com/~boris/tmp/custom-double.zip

It implements serialization of xsd:double in scientific notation.
There is the README file that explains what's going on. When adopting
to your application, you would replace test.xsd with your own schema
and change the code in *-parsing.hxx and *-serialization.hxx if
necessary (e.g., you may want to set your own precisions, etc.).


> A related issue is the handling of +/-INF and NaN 'special values' of
> xsd:double elements (http://www.w3.org/TR/xmlschema-2/#double). Will
> these values be supported by the XSD 3.1 serializer? and by the parser?

Yes, they are supported by the pre-release and the custom-double example.

Boris




More information about the xsd-users mailing list