当前位置: 首页 > 网络学院 > XML相关教程 > XML DOM > DOM CDATA

XML DOM
DOM Attribute
DOM Text
DOM CDATA
DOM Comment
DOM HttpRequest
DOM ParseError
DOM 校验器
DOM 介绍
DOM 摘要
DOM 案例
DOM 节点树
DOM 访问节点树
DOM 节点信息
DOM 文档执行
DOM 节点导航

XML DOM 中的 DOM CDATA


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-01   浏览: 634 ::
收藏到网摘: n/a

The CDATASection object represents a CDATA section in a document.
CDATASection 对象表示某个文档中的CDATA区段。


Examples
案例

In the examples below, we will use the XML file books.xml, and the JavaScript function loadXMLDoc().
在下面的例子中,我们会使用XML文件books.xml,以及JavaScript函数loadXMLDoc()

createCDATASection() - Create a CDATA section node
createCDATASection() - 创建一个CDATA区段节点


The CDATASection object
CDATASection 对象

The CDATASection object represents a CDATA section in a document.
CDATASection 对象代表了文档中CDATA片断。

A CDATA section contains text that will NOT be parsed by a parser. Tags inside a CDATA section will NOT be treated as markup and entities will not be expanded. The primary purpose is for including material such as XML fragments, without needing to escape all the delimiters.
CDATA片断段包含了不会被解析器解析的文本。一个CDATA片断段中的标签不会被视为标记,同时实体也不会被展开。主要的目的是为了包含诸如XML片段之类的材料,而无需转义所有的分隔符。。

The only delimiter that is recognized in a CDATA section is "]]>" - which indicates the end of the CDATA section. CDATA sections cannot be nested.
CDATA片断能够认出的定界符号是“]]>”,它指明了CDATA片断的结尾。CDATA片断不能被嵌套。

IE: Internet Explorer, F: Firefox[火狐], O: Opera, W3C: World Wide Web Consortium (Internet Standard) | 万维网联盟(国际标准)

CDATASection Object Properties
CDATASection 对象属性

Property
属性
Description
描述
IE F O W3C
data Sets or returns the text of this node
设置或返回已选的节点数据
6 1 No Yes
length Returns the length of the CDATA section
返回已选节点中的字符数量
6 1 No Yes

CDATASection Object Methods
CDATASection 对象方法

Method
方法
Description
描述
IE F O W3C
appendData() Appends data to the node
将数据添加到CDATA节点末尾
6 1 No Yes
deleteData() Deletes data from the node
删除CDATA节点中的数据
6 1 No Yes
insertData() Inserts data into the node
将数据插入一个CDATA节点中
6 1 No Yes
replaceData() Replaces data in the node
替换CDATA节点中的数据
6 1 No Yes
splitText() Splits the CDATA node into two nodes
将指定的CDATA节点拆分成两个节点
6 1 No  
substringData() Extracts data from the node
获取CDATA节点中的数据
6 1 No Yes

评论 (0) All

登陆 | 还没注册?