[xsd-users] Double trouble
Esben Skovenborg
EsbenS at TCElectronic.com
Tue Jan 22 11:25:40 EST 2008
Hi Boris,
Your custom-double example was very helpful, and the beta-2 version thus
seems to solve the problems that we've discussed. The new Inf/NaN
support for xsd:double also works well.
Cheers,
Esben
-----Original Message-----
From: Boris Kolpackov [mailto:boris at codesynthesis.com]
Sent: Sunday, January 20, 2008 9:57 AM
To: Esben Skovenborg
Cc: xsd-users at codesynthesis.com
Subject: Re: [xsd-users] Double trouble
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