The text of an XML document is a mix of markup, which gives it structure and meaning, and character data, everything else. Elements, attributes and entity references are the markup you know. The rest of the toolbox shows up in this one partner-feed record, demos/ch02/s2-02/booknest-tour.xml, which Sections 2.2 to Linking and Inclusion take apart:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<?xml-stylesheet type="text/xsl" href="catalog-view.xsl"?>
<!-- BookNest feed for a partner store: one record, every markup component. -->
<catalog xmlns:bn="https://booknest.example.com/ns/catalog"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xi="http://www.w3.org/2001/XInclude"
xml:base="https://booknest.example.com/catalog/" xml:lang="en">
<bn:book xml:id="b3" bn:edition="2">
<title>Salt and Saffron</title>
<title xml:lang="fr">Sel et safran</title>
<contributor xlink:type="simple" xlink:href="authors/priya-nair"
xlink:show="new">Priya Nair</contributor>
<price currency="USD">24.00</price>
<blurb><![CDATA[<p>Recipes from <b>Kerala</b> & Zanzibar</p>]]></blurb>
<shelf-label xml:space="preserve">COOKING aisle 4
shelf 2</shelf-label>
</bn:book>
<xi:include href="more-books.xml" parse="xml"/>
</catalog>From the top: the XML declaration (XML Declaration and Encoding), a processing instruction (XML Processing Instructions), a comment (XML Comments), three namespace declarations (Declaring XML Namespaces), the reserved xml:base, xml:lang, xml:id and xml:space attributes (2.3.3 to 2.3.6), a CDATA section (CDATA Sections), an XLink (XLink Simple Links) and an XInclude (XInclude and Document Assembly). xmllint 3,427 --noout accepts it as well-formed. One component is missing on purpose: the document type declaration, covered with DTDs in Document Type Definitions.
Subsections
Markup Components
Text in an XML document consists of intermingled character data and markup. Markup specifies the structure of the document and some other special semantics. Text that is not markup constitutes the character data.Elements, attributes, and entities are the most familiar markup components. The example below is used throughout this chapter to illustrate the other markup components permitted in an XML document. One other markup component, document type declarations (DTDs), is covered separately; see DTD.
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<bookslist xml:base="http://GoldenBookstore.com"
xmlns:gb="http://GoldenBookstore.com"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xi="http://www.w3.org/2003/XInclude">
<!-- These are the books in Golden Bookstore. -->
<?xml-stylesheet type="text/xsl" href="style.xsl"?>
<gb:book xml:id="b123321" xml:base="/branch1">
<title xml:lang="en" xml:space="preserve">Harry Potter</title>
<author gb:gender="f"
xlink:type="simple"
xlink:href="/images/jkrowling.gif"
xlink:show="new">
J. K. Rowling</author>
<ISBN>9780545010221</ISBN>
<price>22.90</price>
<description>
<![CDATA[<old_price>30.00</old_price>]]>
</description>
<bestseller/>
</gb:book>
<gb:book xml:id="b456654" xml:space="preserve">
<title xml:lang="en">Fantasy in Death</title>
<author gb:gender="f"
xlink:type="simple"
xlink:href="/images/jdrobb.gif"
xlink:show="new">
J. D. Robb</author>
<ISBN>9781101185360</ISBN>
<price>7.81</price>
</gb:book>
<xi:include href="books.xml" parse="xml" />
</bookslist>