O'Reilly logo

Real World XML by Steven Holzner

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CDATA Sections

As you know, XML processors are very sensitive to characters such as < and &. So what if you had a large section of text that contained a great many < and & characters that you didn't want to interpret as markup? You can escape those characters as &lt; and &amp;, of course—but with many such characters, that's awkward and hard to read. Instead, you can use a CDATA section.

CDATA sections hold character data that is supposed to remain unparsed by the XML processor. This is a useful asset to XML. Otherwise, all the text in an XML document is parsed and searched for characters such as < and &. You use CDATA sections simply to tell the XML processor to leave the enclosed text alone and pass it on unchanged to the underlying application. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required