Hi,

you can do for instance:

char* setParser::DOMDocumentToString(DOMDocument* xmlDoc)
{
        const XMLCh gLS[] = { 'L', 'S', chNull };
        DOMImplementation* impl = 
DOMImplementationRegistry::getDOMImplementation(gLS);
        DOMLSSerializer* serializer =
((DOMImplementationLS*)impl)->createLSSerializer();
        DOMLSOutput* output = ((DOMImplementationLS*)impl)->createLSOutput();
        output->setEncoding(XMLUni::fgUTF8EncodingString);
        MemBufFormatTarget* mbft = new MemBufFormatTarget;
        output->setByteStream(mbft);
        serializer->write(xmlDoc,output);
        output->release();
        serializer->release();

        return (char*)mbft->getRawBuffer();
}

On Thu, Jul 8, 2010 at 11:04 PM, B.W.H. van Beest <[email protected]> wrote:
> Hi,
>
> Can somebody please explain to me in some detail what I should do if I
> want to serialise a xercesc::DOMDocument,
> with the xml-output going to some memory buffer, then parse that xml
> buffer and validate it against a given schema?
>
> I read that the parser (XercesDOMParser or SAXParser) have a parse
> method "parse( const InputSource&)" method,
> and that there is a MemBufInputSource derivate class of InputSource, but
> how do I create an approppriate instance from a DOMDocument?
>
>
> Your help is greatly appreciated.
>
> Bertwim
>

Reply via email to