You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Carlos Bazílio <ca...@yahoo.com.br> on 2003/11/05 13:24:45 UTC

Re: parsing strings

Sean,
 
Sorry for late replying.
 
When you sent this message I had already found a similar solution. Now I test your solution and it also works fine.
 
Thanks a lot anyway.
 
Carlos


Sean Kelly <se...@ffwd.cx> wrote:
On Fri, 24 Oct 2003, [iso-8859-1] Carlos Bazílio wrote:
>
> I'm a newbie at Xerces. Since I've started using Xerces, I parsed my XML files using parseURI method from DOMBuilder class. Now I wish to parse a XML provided by a string (char *). How can I do that using DOMBuilder ? Is DOMInputSource a solution ? How can I use it ?

I've only ever used the SAX parser, but I imagine the method is the same.
Here's an example of how to parse data in a std::string:

#include 

...

std::string buf( "" );
MemBufInputSource is( reinterpret_cast( buf.c_str() ),
buf.size(),
"My Parser" );
reader->parse( is );


Sean

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org



---------------------------------
Yahoo! Mail - 6MB, anti-spam e antivírus gratuito. Crie sua conta agora!