1. Take a look at the SimpleXPathAPI sample. It probably does exactly what you want, except that you want to substitute a MemBufInputSource for the LocalFileInputSource that is used. There's also a StreamTransform sample that should help you figure out how to use std::istreams and std::ostreams for input and output. There are lots of sample applications, so you might want to review them for hints on how things work.
2. Xalan has tons of references to "transcode", some of which are calls to Xerces, and some of which are Xalan's implementations. What sort of "cursory" search did you perform? In fact, there's a global operator<<(ostream&, const XalanDOMString&) which will do all of the dirty work for you, if you want to use std::ostringstream.
Dave
[EMAIL PROTECTED]
07/17/2002 10:15 AM | To: [email protected] cc: (bcc: David N Bertoni/Cambridge/IBM) Subject: Newbie needs help with xerces->xalan |
I've been using xercesc MemBufInputSource to create a DOM_Document;
repeatedly query various DOM_NodeList; and transcode() results to
std::string. Now I'd like to use XPath to navigate and extract attributes
and text. Problem is, I can find no equivalent of MemBufInputSource in
xalan. A cursory search for transcode() also turned up nothing.
I get the impression from the xalan docs, <quote>Performance is much better
when Xalan-C++ uses native source tree handling rather than interacting
with the Xerces DOMParser</quote>, that I'd be better off using the
"native" xalan parser but, short of writing the memory image to a hd, I'm
lost - and that still doesn't get me the transcode() functionality.
Could someone point me in the right direction?
TIA
<<inline: graycol.gif>>
<<inline: ecblank.gif>>
<<inline: pic11942.gif>>
