The sample XHTML document illustrated below is very similar to HTML, except for the initial XML declaration
and
we
the
bMa
DTD
thematic
reference.
a User Guide
The latter can be used by an XML parser to validate that the input document is indeed valid
69
XHTML. This demonstrates one of the benefits of XML technology. That is, a parser can validate a document,
checking details such as the different tags being in the correct places and holding the correct number of arguments,
without specializing in the particular flavor of XML. The reference to the DTD is not required; however, it is
necessary if the document is to be validated.
" //W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1 strict.dtd">
Basic XHTML Document
XHTML
This is a basic XHTML document.
This document could be read by modern web browsers and would display in the expected fashion.
XHTML and MathML
To add mathematics and other technical notation to a text document, it is possible to write one document that
contains both XHTML and MathML. A sample document follows.
"http://www.w3.org/TR/MathML2/dtd/xhtml math11
f.dtd" [
]>
Basic XHTML+MathML Document
XHTML+MathML
Here is a math expression.
x
2
This could be read into a browser that provides native support for MathML and would be read as expected. Note the
reference to a DTD that allows the embedding of MathML into XHTML to form an XHTML+MathML document.
Unfortunately, not all browsers support MathML natively. While Mozilla, Amaya, and the most recent versions of
Netscape do give native support for MathML, Internet Explorer does not.
.