> Hi;
>
> I'm trying to build a protocol where the PDUs (i.e. Protocol Data Units)
> are formatted in XML. However taking a look at XERCES-C++, I didnt find a
> way to parse a XML from a binary buffer ( I mean an array of bytes ).
> Looks like xerces only parses XML data that is placed in a file. Since my
> PDU are not files, but an buffer that is loaded through a socket
> connection, how do I parse this XML binary buffer? Do I need to write a
> file and after that parse it? Is that possible with DOM?
>
> Best Regards
>
> Fauze

May i suggest looking at

http://xml.apache.org/xerces-c/apiDocs/classInputSource.html

and

http://xml.apache.org/xerces-c/apiDocs/classMemBufInputSource.html


MemBufInputSource (const XMLByte *const srcDocBytes, const unsigned int
byteCount, const XMLCh *const bufId, const bool adoptBuffer=false,
MemoryManager *const manager=XMLPlatformUtils::fgMemoryManager)

A memory buffer input source is constructed from a buffer of byte data,
and the count of bytes in that buffer.


Enjoy,

Laurent Oget



Reply via email to