如何解决XML中的Ampersand(&)问题? [英] How to solve Ampersand (&) issue in XML?
本文介绍了如何解决XML中的Ampersand(&)问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我正在使用XMLDocument创建XML文件,但是当XML节点获得'&'作为数据时,它将转换为Ampersand(&)amp;但是我需要'&'的实际值,任何人都可以告诉我如何实现它?
解决方案
参见 http://www.w3schools.com/xml/xml_syntax.asp [ ^ ]。
包含XML保留字符&您必须将它们编码为十六进制字符引用。对于&它的十六进制参考是&
请参考 https://support.google.com/checkout/sell/answer/70649?hl=en [ ^ ]有关在XML中编码特殊字符的详细信息。
Hi All,
I am creating XML file using XMLDocument, but when XML node get '&' as data, it converting in "Ampersand(&)amp;" but i need actual value that is '&', Can anyone please tell me how can I achieve it?
解决方案
See http://www.w3schools.com/xml/xml_syntax.asp[^].
To include the XML reserved character & you must encode them as hexadecimal character reference. For & its hexadecimal reference is&
Please refer https://support.google.com/checkout/sell/answer/70649?hl=en[^] for more information on encoding special character in XML.
这篇关于如何解决XML中的Ampersand(&)问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文