TinyXML and preserving HTML Entities

孤街醉人 提交于 2019-12-11 06:25:59

问题


I'm using TinyXml to parse some XML that has some HTML Entities embedded in text nodes. I realize that TinyXML is just an XML parser, so I don't expect or even want TinyXML to do anything to the entities. In fact I want it to leave them alone.

If I have some XML like this:

...
<blah>&uuml;</blah>
...

Calling Value() on the TiXmlText instance I get:

"uuml;"

So TinyXml always seems to remove the ampersand. Is there any way I can get it to leave it alone so it comes out unchanged?

Appreciate any ideas..


回答1:


If you look at the TinyXML documentation you'll see that it recognizes only five character entities (&uuml; is not one of them), plus Unicode code point syntax &#xA0; or &#160;.



来源:https://stackoverflow.com/questions/4392659/tinyxml-and-preserving-html-entities

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!