XML DOM | CDATASection Object

XML DOM - CDATASection Object


Hello folks! welcome back to a new section of our tutorial on XML DOM. In this tutorial guide, we will be discussing about the XML DOM CDATASection Object.

The DOM CDATASection Object represents a CDATA section in a document.

The text present within an XML document is parsed or unparsed depending on what it is declared. If the text is declared as Parsed Character Data(PCDATA) it is parsed by the parser to convert an XML document into an XML DOM Object. On the other hand, if the text is declared as unparsed Character Data (CDATA) the text within is not parsed by the XML parser. These are not considered as a markup and will not expand the entities.


The primary aim of making use of the DOM CDATASection object is to escape the block of text containing characters that would be regarded as markup. The only delimiter that is recognized in a CDATA section is "]]>" that ends the CDATA section.

The CharacterData.data attribute holds the text that is contained by the CDATA section. This interface inherits the CharacterData interface through the Text interface.


Alright guys! This is where we are going to be rounding up for this tutorial post. In our next tutorial, we will be studying about the XML DOM Comment Object.

Feel free to ask your questions where necessary and we will attend to them as soon as possible. If this tutorial was helpful to you, you can use the share button to share this tutorial.

Follow us on our various social media platforms to stay updated with our latest tutorials. You can also subscribe to our newsletter in order to get our tutorials delivered directly to your emails.

Thanks for reading and bye for now.