[xml] Issue extracting text node content



Hi list,
I get a really strange issue using libxml2 for extracting some text node content. 

Indeed, when I get a '+' character in a text node and I use one of GetNodeContent, xmlNodeListGetString or xmlNodeListGetRawString function then in the xmlChar returned I lost the '+' characters. I discovered this when trying to decode base64 string embedded in the XML request received by the application.

I use libxml2 version 2.7.7.

So I am wondering where I failed to use libxml2 properly here. Note that the file used in input is a well formed XML file encoded in UTF-8 and also that I'm not sure that only '+' characters was removed, I just detect this one as the base64 string I dealt with got it.

Here is the code snipest which cause trouble : 

xmlChar* tmp=xmlNodeListGetRawString(doc,cur4->xmlChildrenNode,0);
fprintf(stderr,"[%s]\n",tmp);

I hope you can help me to solve this issue, if I forget to give you any information please let me know.

Hope to hear from you,
best regards,


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