HTML and CSS Reference
In-Depth Information
Compound documents
XHTML + MathML + SVG (using XHTML as the host)
"-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN"
" " >
XHTML + MathML + SVG (using SVG as the host)
"-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN"
" " >
The Root Element in XHTML
All XML documents must contain a root element with the syntax shown in Listing 3-36.
Listing 3-36. Pseudocode of the Root Element
The root element of XHTML documents must be html . Furthermore, the root element must contain an xmlns
attribute to associate it with the XHTML namespace. The namespace URI is for
XHTML 1.0 and XHTML5 documents, and it is for XHTML2 documents.
Consequently, the most common XHTML namespace declaration looks like Listing 3-37.
Listing 3-37. The Most Common XHTML Namespace Declaration
<html xmlns=" " >
The natural language of XML documents is often identified by the xml:lang attribute of the html element 17
(Listing 3-38).
Listing 3-38. Common Use of the xml:lang Attribute
<html xmlns=" " xml:lang="en" >
Namespace Declaration
Beyond the default XHTML namespace , additional ones can also be used in XHTML
documents. For example, XHTML+RDFa documents often use additional namespaces for semantic markup (for more
details, see Chapter 7). In the example shown in Listing 3-39, the namespace of the FOAF Vocabulary Specification
follows the default namespace declaration.
17 Although it is used frequently, this is just one of the many options to identify the XML document language (see Chapter 4).
Search WWH ::

Custom Search