[xsd-users] Treat decimal as string

Boris Kolpackov boris at codesynthesis.com
Fri Feb 15 09:35:56 EST 2019


jesus.herrera at toshibagcs.com <jesus.herrera at toshibagcs.com> writes:

> Is there a simple way to treat xsd:decimal as strings in C++?
> 
> I played around with the --custom-type flag. I was even able to
> have XSD create a header with "typedef std::string decimal" with
> that flag, but then I was seeing a bunch of compilation errors
> (e.g. _clone method not found).

Yes, you are just missing a bit of "glue" code. See the 'double' example
in the examples/cxx/tree/custom/ directory. It does pretty much what you
are trying to do except for xsd:double (and you would want to map to
std::string instead of C++ double). The accompanying README has more
details.



More information about the xsd-users mailing list