HTML and CSS Reference
In-Depth Information
Listing 3-39.
Additional Namespace Declaration
<html version="XHTML+RDFa 1.0"
xmlns="
http://www.w3.org/1999/xhtml
"
xmlns:foaf="
http://xmlns.com/foaf/0.1/
"
xml:lang="en">
In mixed-namespace documents, such as XHTML + MathML + SVG, multiple namespace declarations occur
throughout the document body (unlike the previous ones that are declared in the document head). Listing 3-40 shows
an example.
Listing 3-40.
Namespace Declarations in the
body
of a Compound Document
<!-- ... XHTML content ... -->
<math xmlns="
http://www.w3.org/1998/Math/MathML
"
>
<!-- ... MathML notation ... -->
</math>
<!-- ... XHTML content ... -->
<svg:svg version="1.1"
xmlns:svg="
http
://www.w3.org/2000/svg
" xmlns:xlink="
http://www.w3.org/1999/xlink
"
>
<!-- ... SVG graphic ... -->
</svg>
<!-- ... XHTML content ... -->
The XHTML Head
The title of XHTML documents can be written exactly the same way as in HTML, that is, between the start and end
tags (Listing 3-41).
Listing 3-41.
XHTML Document Title
<title>
Title of the sample XHTML document
</title>
The
meta
,
link
, and
script
elements can be provided in the document head of XHTML like in HTML
documents. However, in XHTML these elements (along with all other elements) should be closed. These empty
elements apply the XHTML shorthand notation (self-closing) (Listing 3-42).
Listing 3-42.
A Self-Closing Link Element in XHTML
<link rel="stylesheet" type="text/css" media="all" href="alt2.css"
title="Alternative style 2"
/
>
In the following example, the
title
attribute is used to indicate search engines that show where to locate the
German and Hungarian versions of the original English document (Listing 3-43). The
xml:lang
attribute declares the
language of the target documents.
Listing 3-43.
Links to Other Language Versions of the Same Document
<head>
<title>The document in English</title>
<link title="Das Dokument auf Deutsch"
rel="alternate"
href="http://example.com/german/"
xml:lang="de" />
Search WWH ::
Custom Search