CDATA代表
Character Data,这意味着这些字符串之间的数据包括可以解释为XML标记的数据,但不应该。
CDATA和注释之间的主要区别是:
> As Richard points out,CDATA仍然是文档的一部分,而注释不是。
>在CDATA中,您不能包括字符串]]> (CDEnd
),而在评论--
is invalid。
> Parameter Entity在注释内部无法识别引用。
这意味着从一个格式良好的文档中提供这三个XML片段:
<!ENTITY MyParamEntity "Has been expanded">
<!-- Within this comment I can use ]]> and other reserved characters like < &,',and ",but %MyParamEntity; will not be expanded (if I retrieve the text of this node it will contain %MyParamEntity; and not "Has been expanded") and I can't place two dashes next to each other. -->
<![CDATA[ Within this Character Data block I can use double dashes as much as I want (along with <,&,and ") *and* %MyParamEntity; will be expanded to the text "Has been expanded" ... however,I can't use the CEND sequence (if I need to use it I must escape one of the brackets or the greater-than sign). ]]>
原文地址:https://www.jb51.cc/xml/294360.html
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。