HTML and CSS Reference
In-Depth Information
•
Compound documents
•
XHTML + MathML + SVG (using XHTML as the host)
<!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN"
•
XHTML + MathML + SVG (using SVG as the host)
<!DOCTYPE svg:svg PUBLIC
"-//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
<root>
<child>
<subchild>.....</subchild>
</child>
</root>
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
http://www.w3.org/1999/xhtml
for
Consequently, the most common XHTML namespace declaration looks like Listing 3-37.
Listing 3-37.
The Most Common XHTML Namespace Declaration
<html
xmlns="
http://www.w3.org/1999/xhtml
"
>
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="
http://www.w3.org/1999/xhtml
"
xml:lang="en"
>
Namespace Declaration
Beyond the default XHTML namespace
http://www.w3.org/1999/xhtml
,
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