Coker, Jonathan M wrote:
Hello,
I would like to be able to us Xalan/XPath to extract data from a
chunk of XML that I will be receiving over a network. My current plan
involves using Xerces, MemBufInputSource, and the
XercesDOMWrapperParsedSource to get a Xalan document. Is there an
easier more direct way to do this? I am trying to avoid SAX2 because I
would like to us XPath, and I saw no interoperability with that. Thanks
for any help.
I don't think there's any reason for you to use the Xerces DOM and
XercesDOMWrapperParsedSource to do this, unless you're building the DOM
programmatically, or you need to build it and modify it.
The easiest thing to do is to use XalanTransformer::parseSource() to create
the tree. You can then use that tree for transformation.
If you're just using the XPathEvaluator class, and you have no need for
XSLT, take a look at the SimpleXPathAPI sample application.
There are already some network accessor options in Xerces-C to read XML
documents, so you might want to see if one of those will work for you. I
know HTTP and HTTPS URLs are supported, but I'm not sure if FTP URLs are as
well.
Dave