是字符 # 或 &允许在 xml 中? [英] are characters # or & allowed in xml?
本文介绍了是字符 # 或 &允许在 xml 中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在我的 xml 中有编码为 ascii 的特殊字符的值.例如:
i have values with special chars that encoded to ascii in my xml. for example :
<?xml version="1.0" encoding="UTF-8"?>
<response>
<name>Žirmūnų</name>
</response>
但是当我解析值 name
时,我只得到 &
作为值.是否允许在 xml 中使用 #
或 &
?还是我必须使用 cdata?
but when i parse value name
i get only &
as value.
Is it allowed to use #
or &
in xml? or i have to use cdata necessarily?
推荐答案
The &字符似乎是非法的,请改用(下).
The & character appears to be illegal, use (below) instead.
&
# 字符应该没问题.
这也可能有用:http://xml.silmaril.ie/specials.html.
这篇关于是字符 # 或 &允许在 xml 中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文