Text Handling

Displaying simple text works the same way in XHTML as it does in HTML: You just place the text directly in a document. XHTML elements that display text have mixed-content models, so they can contain both text and other elements, as in this example we saw earlier:

<?xml version="1.0"?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
        <title>
            Welcome to my page
        </title>
    </head>
    <body bgcolor="white" text="black" link="red" alink="blue"
        vlink="green">
        Welcome to my XHTML document.
					Want to check out more about XHTML?
					Go to
					<a href="http://www.w3c.org">W3C</a>.
    </body>
</html>

The text ...

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.