2008/11/14 Andrew Hartley <[EMAIL PROTECTED]>:
>
> Having streamed the std::string content (the Xml) to file in Debug mode and
> Release mode, I have found that the Xml in Debug mode is ok (as I knew) BUT
> in Release mode the Xml string has the following HEX characters appended at
> the end:
>
> 0x50 0x41 0x44 0xD0 0x03 0x34
>
> !!!  Unless I find a reason for this I will just have to check for it and
> strip these extra PADing chars off.

Yes do what you have to do. In any case this is beyond the control of
the libxml2 library, which expects input to be valid XML, nothing
else.

Hope you'll figure it out.

Elvis

>
>
>
> Andrew Hartley wrote:
>>
>> I have written a DLL with a large (size = 1318109 chars) XML stored as a
>> resource.  I read the XML into a std::string and load it with a call to
>> xmlReadMemory:
>>
>> xmlDocPtr pXmlDoc = xmlReadMemory(sXml, sXml.length(), "xml", NULL, 0);
>>
>> This works fine in Debug mode.  But when I switch to Release mode I get
>> NULL returned and the error text is "Extra content at the end of the
>> document".
>>
>> I have tried parsing the std::string content into a char*, and setting the
>> argv[3] to "UTF-8":
>>
>>              int nLen = (int)sXml.size();
>>       char* pszContent        = new char[nLen +2];
>>
>>       strcpy_s(pszContent, nLen +2, sXml.c_str());
>>       pszContent[nLen]                = '\n';
>>       pszContent[nLen +1]     = '\0';
>>
>>       xmlDocPtr pXmlDoc = xmlReadMemory(pszContent, nLen, "xml", "UTF-8", 0);
>>
>>       delete[] pszContent;
>>       pszContent = NULL;
>>
>> But I still get the same error!
>>
>> I have not resorted to attempting to debug through LibXml2 yet, and would
>> appreciate any advice.
>>
>
> --
> View this message in context: 
> http://www.nabble.com/xmlReadMemory-%3A-error-%22Extra-content-at-the-end-of-the-document%22-tp20484750p20497584.html
> Sent from the Gnome - Lib - Xml - General mailing list archive at Nabble.com.
>
> _______________________________________________
> xml mailing list, project page  http://xmlsoft.org/
> [email protected]
> http://mail.gnome.org/mailman/listinfo/xml
>
_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
[email protected]
http://mail.gnome.org/mailman/listinfo/xml

Reply via email to