什么是PCDATA和CDATA? [英] what actually is PCDATA and CDATA?

查看:134
本文介绍了什么是PCDATA和CDATA?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

看起来,PCDATA和CDATA的松散定义是:PCDATA是字符数据,但是 >被解析。
  • CDATA是字符数据,不是可以解析。

  • 但是后来有人告诉我说CDATA实际上是被解析的,或者PCDATA实际上没有被解析......所以这有点混乱。有人知道真正的交易是什么吗?



    更新:我实际上在Wikipedia上添加了PCDATA定义...所以不要回答这个问题因为这只是我粗略的理解。

    解决方案

    来自WIKI:



    PCDATA


    简单地说,PCDATA代表解析字符数据。这意味着字符将被XML,XHTML或HTML解析器解析。 (& lt; 将改为<,< p> 等)。与CDATA进行比较,其中字符不会被XML,XHTML或HTML解析器解析。


    CDATA


    CDATA,意思是字符数据,用于标记语言SGML和XML中的不同但相关的目的。该术语表示文档的某个部分是通用字符数据,而非非字符数据或具有更具体,限制结构的字符数据。


    it seems that a loose definition of PCDATA and CDATA is that

    1. PCDATA is character data, but is to be parsed.
    2. CDATA is character data, and is not to be parsed.

    but then someone told me that CDATA is actually parsed or PCDATA is actually not parsed... so it is a bit of a confusion. Does anyone know the real deal is?

    Update: I actually added the PCDATA definition on Wikipedia... so don't take that answer too seriously as that's only my rough understanding of it.

    解决方案

    From WIKI:

    PCDATA

    Simply speaking, PCDATA stands for Parsed Character Data. That means the characters are to be parsed by the XML, XHTML, or HTML parser. (&lt; will be changed to <, <p> will be taken to mean a paragraph tag, etc). Compare that with CDATA, where the characters are not to be parsed by the XML, XHTML, or HTML parser.

    CDATA

    The term CDATA, meaning character data, is used for distinct, but related purposes in the markup languages SGML and XML. The term indicates that a certain portion of the document is general character data, rather than non-character data or character data with a more specific, limited structure.

    这篇关于什么是PCDATA和CDATA?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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