Fwd: Re: [xsd-users] Problem accessing basic datatypes behind XML types

Philipp Schmidt philschmidt at gmx.net
Mon Jul 2 04:41:49 EDT 2012


Sorry, forgot to press "answer all" -.-

Am Montag, 2. Juli 2012, 10:21:50 schrieben Sie:
> >   std::string name = valueReport.name();
> 
> Maybe like this?
> std::string name(valueReport.name().c_str());
> 
> cheers,
> Erik Sjölund

Hi,

that works for non-optional values. I now found out that for optional values 
you check if they are set with present() (did that already elsewhere in the 
code) and then get() the data... So for example:

std::string name = value.name().present() ? value.name().get() : "";

Same goes for all other value types.

Thanks for the fast feedback!

cheers,
Philipp Schmidt


More information about the xsd-users mailing list