[xml] Parsing XML with huge text nodes




I am using LibXml2 v2.7.6 and parsing an XML document that has a couple of
huge text nodes, approx 16MB.

I see that there is an option of setting a context option to XML_PARSE_HUGE. 
I would appreciate if someone could let me know where I need to set this. 
Here is a snippet of my code:

xmlLoadExtDtdDefaultValue = XML_DETECT_IDS | XML_COMPLETE_ATTRS;
xmlSubstituteEntitiesDefault(1);

m_pXmlDoc = xmlParseFile(szFilename);

...

// do some stuff and also perform c14n etc...

xmlChar* output = NULL;
int len = 0;

xmlDocDumpMemory(m_pXmlDoc, &output, &len);

if (output)
{
   xmlSaveCtxPtr pSaveCtx = xmlSaveToFilename(szNewFilename, NULL, 0);
   long r = xmlSaveDoc(pSaveCtx, m_pXmlDoc);
   ret = xmlSaveClose(pSaveCtx);
   rsXml = CString(output);
   xmlFree(output);
}
...
-- 
View this message in context: http://old.nabble.com/Parsing-XML-with-huge-text-nodes-tp26675908p26675908.html
Sent from the Gnome - Lib - Xml - General mailing list archive at Nabble.com.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]