Difference between PCDATA and CDATA
来源:互联网 发布:自贸区政策 知乎 编辑:程序博客网 时间:2024/04/28 10:23
> #PCDATA [...] specifies that an element will contain parsed
> character data. Parsing tests whether the characters conform to the
> lexical constraints imposed by XML 1.0.
>
> CDATA appears in attribute declarations and specifies that an
> attribute will contain character data that is not parsed.
That's not accurate. All characters in an XML document are "parsed" in
the sense that you describe.
"CDATA" is a token used in an attribute declaration to declare the
attribute as having a string type. '&', and '<' and the quote character
used for delimiting the attribute value have special meaning in
attributes of this type.
"#PCDATA" is a token used in an element declaration to declare the
element as having mixed content (character data, or character data mixed
with other elements). The content of the element is parsed; '&' and '<'
have special meaning and must be escaped if they aren't the start of
markup.
A "CDATA section", bounded in markup by "<![CDATA[" and "]]>" is, by
comparison, "unparsed" character data (though even it is subject to at
least one restriction -- it can't contain "]]>"). A CDATA section can
only appear in element content, and it has nothing to do with the
"CDATA" token used in attribute decls.
> character data. Parsing tests whether the characters conform to the
> lexical constraints imposed by XML 1.0.
>
> CDATA appears in attribute declarations and specifies that an
> attribute will contain character data that is not parsed.
That's not accurate. All characters in an XML document are "parsed" in
the sense that you describe.
"CDATA" is a token used in an attribute declaration to declare the
attribute as having a string type. '&', and '<' and the quote character
used for delimiting the attribute value have special meaning in
attributes of this type.
"#PCDATA" is a token used in an element declaration to declare the
element as having mixed content (character data, or character data mixed
with other elements). The content of the element is parsed; '&' and '<'
have special meaning and must be escaped if they aren't the start of
markup.
A "CDATA section", bounded in markup by "<![CDATA[" and "]]>" is, by
comparison, "unparsed" character data (though even it is subject to at
least one restriction -- it can't contain "]]>"). A CDATA section can
only appear in element content, and it has nothing to do with the
"CDATA" token used in attribute decls.
- Difference between PCDATA and CDATA
- What is the difference between CDATA and PCDATA?
- The difference between (()) and ().
- difference between "<" and "<<"
- CDATA 与 PCDATA区别
- PCDATA和CDATA
- CDATA和PCDATA
- PCDATA和CDATA区别
- Difference Between typedef and #define
- Difference between CComPtr and CComQIPtr
- Difference between RVCT and GCCE
- Difference between RVCT and GCCE
- difference between slist and list.
- difference between stack and heap
- Difference between replace and translate
- Difference between PrintWriter and PrintStream
- difference between Cookie and Session
- Difference Between Buffer and Cache
- LAMP挑战.Net、Java 商业软件呈三足鼎立
- (转)2005 新鲜出炉的最爆笑的口误(经典)
- struts与velocity结合的简单介绍--找棵树吊死
- serverVariables参数
- 一个优秀IT专家的成长历程---献给所有的颓废或即将颓废的人们
- Difference between PCDATA and CDATA
- 35岁前成功的12条黄金法则
- 网上最变态的网名
- 测试GD库是否能够成功运行了
- Linux-Unix环境下的make命令详解(转载)
- 一个it人的奋斗
- 图片随着鼠标滑轮改变大小
- 失戀萬歲的20個理由
- EU Quotas on Clothing Under Fire