You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xerces.apache.org by "Harelick, Matthew" <MH...@ise.com> on 2011/12/19 20:24:04 UTC
Converting from wide characters to standard C++ strings
Hi:
I know that my parser will not be used to process wide character strings.
1) How do I derive a standard c++ string from XMLCh* ?
2) How do I derive it such a way that I can manage the memory myself and not be forced to use XMLString::Release.
I want to use Xerces to process my xml doc, but once the information is captured I would like to terminate it and manage the data myself. I do not want to have to use the Xerces representation and memory management for the full life of my application.
Thanks
Matthew Harelick
Re: Converting from wide characters to standard C++ strings
Posted by Siva Chandran P <si...@gmail.com>.
Hi Matthew Harelick,
You can use XMLString::transcode to convert "XMLCh" based string into
"char" based string. The memory would be allocated by Xerces but you
can immediately assign it to std::string object and release the memory
using XMLString::release. Ofcourse this is not a straight forward way
but it works.
Thanks & Regards,
Siva Chandran P
On Tue, Dec 20, 2011 at 12:54 AM, Harelick, Matthew <MH...@ise.com> wrote:
> Hi:
>
> I know that my parser will not be used to process wide character strings.
>
>
> 1) How do I derive a standard c++ string from XMLCh* ?
>
> 2) How do I derive it such a way that I can manage the memory myself and not be forced to use XMLString::Release.
>
>
> I want to use Xerces to process my xml doc, but once the information is captured I would like to terminate it and manage the data myself. I do not want to have to use the Xerces representation and memory management for the full life of my application.
>
> Thanks
>
> Matthew Harelick