[xsd-users] Compilation error with xsd:decimal mapped to long double

Felix Hoppe hoppef at hsu-hh.de
Mon Sep 12 05:17:50 EDT 2022


Am 11.09.22 um 13:50 schrieb Boris Kolpackov:
> Hm, that email doesn't actually describe how to do that, it just points
> to the cxx/tree/custom/double example which in turn refers (from its
> README) to:
>
> http://wiki.codesynthesis.com/Tree/Customization_guide
>
> In this case, we are interested in Section 5, "Customizing the XML Schema
> built-in types".

Yes, I actually followed this example, which I found in one of the mails:

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

> I believe some of the steps described in the above example/guide are
> missing. Can you describe exactly what you have done and also show your
> traits specialization for the xs:decimal to C++ long double mapping?

Hence, what I did are the following steps (with some minor modifications 
like --hxx-suffix .h --cxx-suffix .cpp):

/xsdcxx cxx-tree --std c++11 --generate-serialization 
--generate-xml-schema  --hxx-suffix .h --cxx-suffix .cpp --custom-type 
double=double --custom-type "decimal=long double" --hxx-epilogue-file 
xml-schema-epilogue.h xml-schema.xsd/

/xsdcxx cxx-tree --std c++11 --root-element-last  --hxx-suffix .h 
--cxx-suffix .cpp --extern-xml-schema xml-schema.xsd 
--generate-serialization vtk-unstructured.xsd/

/xsdcxx cxx-tree --std c++11 --root-element-last  --hxx-suffix .h 
--cxx-suffix .cpp --extern-xml-schema xml-schema.xsd 
--generate-serialization vtk-punstructured.xsd/

Here, the 'xml-schema-epilogue.h' is exactly the same as found in 
'custom-double.zip'. Also the files 'decimal.h', 'decimal-parsing.h', 
'decimal-serialization.h', 'double-parsing.h' and 
'double-serialization.h' are unchanged except from changing the extension.


More information about the xsd-users mailing list