XML DOM tutoria...login
XML DOM tutorial
author:php.cn  update time:2022-04-13 15:27:56

DOM - CDATASection object



tryitimg.gifTry it - Example


The example below uses the XML file books.xml.
External JavaScript is used to load XML files.

createCDATASection() - Creates a CDATA section node


CDATASection object

The CDATASection object represents a CDATA section in the document.

The CDATA section contains text that will not be parsed by the parser. Tags in a CDATA section are not treated as tags, and entities are not expanded. The main purpose is to contain material such as XML fragments without escaping all delimiters.

The only recognized delimiter in a CDATA section is "]]>", which marks the end of the CDATA section. CDATA sections cannot be nested.

CDATASection Object Properties

#PropertiesDescription
dataSet or return the text of this node.
lengthReturns the length of the CDATA section.

CDATASection Object Method

MethodDescription
appendData()Append data to the node.
deleteData()Delete data from the node.
insertData()Insert data into the node.
replaceData()Replace the data in the node.
splitText()Split the CDATA node into two nodes.
substringData()Extract data from the node.

php.cn