DOM - CDATASection object
Try 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
#Properties | Description |
---|---|
data | Set or return the text of this node. |
length | Returns the length of the CDATA section. |
CDATASection Object Method
Method | Description |
---|---|
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. |