Skip to notes.The slides are typically visually-oriented graphics, but the notes contain enough information to understand the tutorial.
Slide

Choosing the right attribute

When serving HTML, rather than XHTML, you should use the lang attribute to declare the language of the document or a range of text. For example, the following declares a document to be in Canadian French:

<html lang="fr-CA">

When serving XHTML as text/html, you should use both the lang attribute and the xml:lang attribute. The xml:lang attribute is the standard way to identify language information in XML. The following example shows how you would mark up the previous example for XHTML 1.0 served as text/html.

<html lang="fr-CA" xml:lang="fr-CA" xml‍ns="http://www.w3.org/1999/xhtml">

The xml:lang attribute is not actually useful for handling the file as HTML, but takes over from the lang attribute any time you treat the document as XML for, say, scripting or validation.

If you are serving XHTML 1.0 pages as XML (ie. using a MIME type such as application/xhtml+xml), or serving pages as XHTML 1.1, you do not need the lang attribute, since lang is part of the HTML language. The xml:lang attribute alone will suffice.

<html xml:lang="fr-CA" xml‍ns="http://www.w3.org/1999/xhtml">

Version: $Id: Slide0160.html,v 1.3 2006/02/02 10:05:47 rishida Exp $