You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Milan Tomic <mi...@setcce.org> on 2004/06/09 10:37:29 UTC

MemBufFormatTarget(maxLen) - ctor

	This is how I get XML from DOM:

DOMWriter *dw = impl->createDOMWriter();
Janitor<DOMWriter> j_dw(dw);
dw->setEncoding(X("UTF-8"));

XMLFormatTarget *myFormTarget = new MemBufFormatTarget(maxLen);
Janitor<XMLFormatTarget> j_myFormTarget(myFormTarget);

if (!dw->writeNode(myFormTarget, *doc)) {
    //error
}

const XMLByte* pcBuf =
((MemBufFormatTarget*)myFormTarget)->getRawBuffer();
unsigned int uiBufLen = ((MemBufFormatTarget*)myFormTarget)->getLen();

	The problem is in MemBufFormatTarget(maxLen). Is there any way
to calculate maxLen (max bytes needed for XML) or is there any other
(fast and low memory consuming) way to retrive XML from DOM?

Thank you.