TinyXML的和preserving HTML实体 [英] TinyXML and preserving HTML Entities

查看:196
本文介绍了TinyXML的和preserving HTML实体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用TinyXml的解析一些XML具有嵌入文本节点某些HTML实体。我认识到,TinyXML的只是一个XML解析器,所以我不希望,甚至希望TinyXML的做任何的实体。事实上,我希望它独自离开他们。

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.

如果我有一些这样的XML:

If I have some XML like this:

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

在TiXmlText实例调用值()我得到:

Calling Value() on the TiXmlText instance I get:

"uuml;"

所以TinyXml的似乎总是去除符号。有没有什么办法可以让它所以它出来不变息事宁人?

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?

鸭preciate任何想法。

Appreciate any ideas..

推荐答案

如果你看一下 TinyXML的文档你会看到,它承认只有五个字符实体(&放大器; uuml; 是不是其中之一),加上统一code code地点语法&放大器;#XA0; &放大器;#160;

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;.

这篇关于TinyXML的和preserving HTML实体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆