If you call transcode(pIn), you must release the returned buffer. If you call
transcode(pIn, pOut, nOut), then Xerces will "reuse" the buffer you give it.
Adam Heinz
Senior Software Developer
Exstream Software
-Original Message-
From: Sean Kelly [mailto:[EMAIL PROTECTED]
Sent: Wednesd
On Wed, 26 May 2004, Adam Heinz wrote:
>
> These lines leak memory. If you don't pass an output buffer to transcode, you need
> to XMLString::release() the returned buffer.
Something I wasn't sure on from the documentation. Does transcode reuse
the same buffer and grow as needed or does it allo
Thanks for all the tips. After removing any node list calls and
getElementByName calls, it now only takes 10 seconds to acquire 112,000
words. Not bad compared to the 5 seconds it takes with a messy text file. I
would never have guessed a linklist data structure was used from DOM trees
or whatnot.
At 10.21 26/05/2004 -0400, Nath wrote:
Sure thing,
[..]
// Get word nodes
cXMLNodeList = cXMLDoc->getElementsByTagName(XMLString::transcode("word"));
Hi Nath,
I see a couple of spots that could affect performances:
1) getElementsByTagName navigates through all the nodes, and builds a list
containi
Hello,
I want to omit xml declaration from my xml documents, and i didn't succed.
I have an xml file without this declartion. I parse them with a XercesDOMParser and after that i serialize.
The result is with the xml declaration.
Can i drop it without making substr or something ?
Thanks, Crist
First of all, do not use getElementByTagname. It traverses and looks at
ALL nodes in the tree. Think of it as a string compare on each tag in
the document. It will take a long time on large documents. Use
FirstChild NextSibling instead. If you are SURE you have a valid
document structure you can sk
cXMLNodeList = cXMLDoc->getElementsByTagName(XMLString::transcode("word"));
strcpy(name, XMLString::transcode(cChildNodeList->item(j)->getTextContent());
These lines leak memory. If you don't pass an output buffer to transcode, you need to
XMLString::release() the returned buffer.
Adam Heinz
Se
Sure thing,
// Member variables
XercesDOMParser *cXMLParser;
XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *cXMLDoc;
DOMNodeList *cXMLNodeList,
*cChildNodeList;
DOMNode *cXMLNode;
DOMNamedNodeMap *cXMLNamedNode;
// Initialization
XMLPlatformUtils::Initialize();
c