[xml] ampersand conversion




Hi,

this code is giving me "error : unterminated entity reference" with
libxml2-2.6.16

xmlNodePtr node = xmlNewNode(NULL, BAD_CAST "test");
if( node ) {
        const char* str = "<>\"'&";
        xmlNodeSetContent(node, BAD_CAST str);
}

I know, that some specific character have to be encoded/quoted, but all
others are already being encoded internally and I would just have to
replace the ampersand by myself. Is this a wanted behavior? Because it
seems a bit inconsistent to me encoding all the others, but not the
ampersand.

So long
Oliver



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