Markup and Character Data

XML documents are made up of markup and character data (and possibly, one day, binary data, but there is no provision for enclosing binary data in a document made up of markup and character data yet—until there is, you refer to external binary data with entity references, as we'll see).

The markup in a document gives it its structure. Markup includes start tags, end tags, empty-element tags, entity references, character references, comments, CDATA section delimiters (we'll see more about CDATA sections in a few pages), DTDs, and processing instructions. So what's the character data in an XML document? All the text in a document that is not markup is character data.

Here's a quick example using markup and character data ...

Get Real World XML now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.