XML DOM - CDATASection object

## XML DOM Tutorial

DOM HOME DOM Introduction DOM Nodes DOM Node Tree DOM Parser DOM Load Function DOM Methods DOM Accessing DOM Node Info DOM Node List DOM Traversing DOM Browsers DOM Navigating

## Manipulate Nodes

DOM Get Values DOM Change Nodes DOM Remove Nodes DOM Replace Nodes DOM Create Nodes DOM Add Nodes DOM Clone Nodes DOM XMLHttpRequest

## XML DOM Reference

DOM Node Types DOM Node DOM NodeList DOM NamedNodeMap DOM Document DOM DocumentImpl DOM DocumentType DOM ProcessingInstr DOM Element DOM Attribute DOM Text DOM CDATA DOM Comment DOM XMLHttpRequest DOM ParseError Obj DOM Parser Errors
DOM Summary

## XML DOM Examples

DOM Examples DOM Validator

# XML DOM - The CDATASection Object

« Previous
Next Chapter »

## Try it Yourself - Examples

The examples below use the XML file books.xml.
An external JavaScript is used to load the XML file.

createCDATASection() - Create a CDATA section node

## The CDATASection object

The CDATASection object represents a CDATA section in a document.

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.

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

## CDATASection Object Properties

Property | Description
--- | ---
data | Sets or returns the text of this node
length | Returns the length of the CDATA section

## CDATASection Object Methods

Property | Description
--- | ---
appendData() | Appends data to the node
deleteData() | Deletes data from the node
insertData() | Inserts data into the node
replaceData() | Replaces data in the node
splitText() | Splits the CDATA node into two nodes
substringData() | Extracts data from the node

« Previous
Next Chapter »

## Your suggestion:

Your E-mail (optional):

Page address:

Description:

Close [X]

## Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

## WEB HOSTING

Best Web Hosting UK Reseller Hosting Wow! $5 SSD Hosting

## WEB BUILDING

Download XML Editor
FREE Website BUILDER FREE Website Creator

## WEB RESOURCES

Web Statistics Web Validation

## SHARE THIS PAGE