XML中的特殊字符 [英] Special character in XML

查看:264
本文介绍了XML中的特殊字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我的XML文件带有特殊字符,& < > " ‘

当我将XML文件读入数据表时,它以正确的格式显示信息.
即< > " ‘替换为&< > "

当我添加新行并将数据表写回到XML时,特殊字符
&< >替换为& < >得到,但" ‘不能用和"代替.

当我将数据表写入XML时,如何替换特殊字符"‘通过和"?


谢谢,
Somnath.

Hi,

I have xml file with special character, & < > " '

When I read XML file into data table it displays information in correct format.
i.e & < > " ' is replaced by & < > " ''

When I do add new row and write data table back to XML , special characters
& < > replaced by & < > get , but " ' not replaced by " and ''.

when I write data table to XML, How to replace special character " ' by " and '' ?


Thanks,
Somnath.

推荐答案

我会说没关系.
还是您的XML数据的某些使用者有任何问题?
特殊字符实体&apos;&quot;仅在属性值内相关.否则,可以使用普通的和".
干杯
安迪
I would say it''s ok as it is.
Or do you have any issues with some consumers of your XML data?
The special character entities &apos; and &quot; only are relevant within attribute values. Otherwise, the plain " and '' can be used.
Cheers
Andi


这篇关于XML中的特殊字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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