XML中的<![CDATA []]>是什么意思?
发布时间:2020-12-16 02:07:20 所属栏目:百科 来源:网络整理
导读:我经常在XML文件中找到这个奇怪的CDATA标签: ![CDATA[]] 我观察到这个CDATA标签总是在开始,然后是一些东西。 但有时它被使用,有时它不是。我假设是标记一些数据将插入之后。但是什么样的数据?是不是我写的XML标签的某种数据? CDATA代表 Character Data
我经常在XML文件中找到这个奇怪的CDATA标签:
<![CDATA[]]> 我观察到这个CDATA标签总是在开始,然后是一些东西。 但有时它被使用,有时它不是。我假设是标记一些数据将插入之后。但是什么样的数据?是不是我写的XML标签的某种数据?
CDATA代表
Character Data,这意味着这些字符串之间的数据包括可以解释为XML标记的数据,但不应该。
CDATA和注释之间的主要区别是: > As Richard points out,CDATA仍然是文档的一部分,而注释不是。 这意味着从一个格式良好的文档中提供这三个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). ]]> (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |