Hi Dan,

Parsing a file is no different than parsing a memory buffer (or any
other input source). They all use BinInputStream internally if you look
at the Xerces-C++ implementation. All you need to do is create the
MemBufInputSource and pass it to parser's parse() method (see the API
doc
http://xerces.apache.org/xerces-c/apiDocs/classAbstractDOMParser.html#b6
fbd6cdf84cce77db1c780017d107dd). 

DOM parser's parse() method is overloaded to accept a system id (a file
path or URL) or an InputSource, which can be a LocalFileInputSource, a
URLInputSource, a StdInInputSource, a Wrapper4DOMInputSource, or a
MemBufInputSource (see
http://xerces.apache.org/xerces-c/apiDocs/classInputSource.html). 

Cheers,


-Ozgur Sahoglu

-----Original Message-----
From: Dan Arcari [mailto:[EMAIL PROTECTED] 
Sent: Monday, May 12, 2008 11:05 AM
To: [email protected]
Subject: Using MemBufInputSource with DOM parser

Hello,

We have a library written on top of Xerces-c which uses DOM parsing of
file-based XML. We would like to be able to send a MemBufInputSource (or
derivation) via our library to xerces so we can parse XML which does not
reside in a file. Is this possible, and could anyone share some examples
or
advice on how to go about this?

Thanks

Reply via email to