更换>中,<,&安培;该XML节点内出现的字符 [英] Replace >, <, & chars that appear inside XML nodes
本文介绍了更换>中,<,&安培;该XML节点内出现的字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
http://stackoverflow.com/questions / 2282614 /正则表达式到匹配字符 - 即-出现-内部的XML节点
我有一个几乎张玉峰问题这一点 - 但是,我使用C#。
I have an almost indentical problem to this - however, I am using C#.
我不是来争论XML的有效性。
I'm not here to argue the validity of the XML.
什么获取发送超出。我的控制
What gets sent in is out of my control.
输入XML:
<PNODE>
<CNODE>This string contains > and < and & chars.</cnode>
</PNODE>
我需要它看起来像这样:
<PNODE>
<CNODE>This string contains > and < and & chars.</CNODE>
</PNODE>
它看起来像的家伙找到了PHP的解决方案不帮我。
It looks like the guy found a solution for PHP- which doesn't help me.
不过,我需要找到一种方式逃避和放大器;,>和<该节点内的字符,但先不谈标签声明
However, I need to find a way escape the &, > and < characters inside the node, but leave the tag declarations alone.
推荐答案
检查出的 Tidy.Net 。这是一个.NET实现整洁。
Check out Tidy.Net. It's a .Net implementation of Tidy.
这篇关于更换>中,<,&安培;该XML节点内出现的字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文