< & >被转换成& & lt;等等 [英] < & > are converted to > < etc

查看:1329
本文介绍了< & >被转换成& & lt;等等的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用MSXMl库来解析xml

I am using MSXMl library to parse xml

后,我调用put_text然后get_xml

after I call put_text and then get_xml

将具有< & >转换为& lt; & & gt;

如何摆脱这个?

推荐答案

<和>被禁止在文本内使用,需要被编码为& gt和& lt。避免这种情况的唯一方法是为包含那些的文本创建一个CDATA部分。但是你真的不需要如果你打算用XML读XMLT - 它将解码这些符号很好,你会得到你的<和>在提取的文本中完全精细。

< and > are prohibited to use inside the text and need to be encoded as &gt and &lt. The only way to avoid this is creating a CDATA section for the text containing those. But you really don't need to if you intend to read the XMLT with MS XML - it will decode those symbols just fine and you will get your < and > perfectly fine in the extracted text.

这篇关于&lt; &amp; &gt;被转换成&amp; &amp; lt;等等的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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