how to parse an xml message in std::string (C++) using xerces sax2

M

muralibala68

Hi,

How do I parse an xml message that is in std::string using sax2 parse
method that does not seem to take a string and expects a filename?

Thanks.
 
P

Pavel Lepin

How do I parse an xml message that is in std::string using
sax2 parse method that does not seem to take a string and
expects a filename?

The API reference seems to indicate you'd have to construct
a MemBufInputSource from your std::string (statically cast
a pointer to the first character to XMLByte*), then supply
the resulting object as a parameter to the overloaded
parse() member function.
 
M

muralibala68

The API reference seems to indicate you'd have to construct
a MemBufInputSource from your std::string (statically cast
a pointer to the first character to XMLByte*), then supply
the resulting object as a parameter to the overloaded
parse() member function.

Thanks Pavel. It works now. Found some more useful info in
MemParse.cpp from 'samples' too.

Cheers.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top