[xsd-users] Treat decimal as string

jesus.herrera at toshibagcs.com jesus.herrera at toshibagcs.com
Thu Feb 14 09:58:43 EST 2019


Hi,


Is there a simple way to treat xsd:decimal as strings in C++?


I read the "Customizing the XML Schema built-in types" page in the "Tree/Customization guide", but std::string should not be subclassed like in the example (because no virtual destructor).


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).


I can create a custom class that wraps an std::string attribute, and provide an accessor method that returns the attribute, but I hope there's a simpler way.


Thanks,

Jesus Herrera


More information about the xsd-users mailing list