LibXML2 Sax Parsing and ampersand

前端 未结 1 995
星月不相逢
星月不相逢 2021-02-06 10:47

I\'ve encountered (what I think is) a strange behavior when using the sax parser, and I wanted to know if it\'s normal.

I\'m sending this XML through the SAX parser:

1条回答
  •  攒了一身酷
    2021-02-06 11:02

    This message describes the same problem (which I had as well) and the response says to

    ask the parser to replace entities values

    What that means is when you are setting up your context, set the option like this:

    xmlParserCtxtPtr context = xmlCreatePushParserCtxt(&yourSAXHandlerStruct, self, NULL, 0, NULL);
    xmlCtxtUseOptions(context, XML_PARSE_NOENT);
    

    0 讨论(0)
提交回复
热议问题