HTML, XML and XHTML

Derek Bridge

Department of Computer Science,
University College Cork

HTML, XML and XHTML

Aims:

Web browsers

We can see the need for standards [Pie chart showing browser market share as of Augist 2007.]

Invention of the world wide web

Between 1989 and 1991, Tim Berners-Lee, working at CERN, invented

Tim Berners-Lee photo from W3C Large hadron collider photo from CERN

A potted history of HTML standards

Date HTML standards Web browsers
Early 1991 The first web browser
Late 1991 The first published description of HTML
1992 Staff & students at NCSA develop the Mosaic browser
1993 The first proper specification of HTML (based on SGML) is published The Netscape Communications Corporation is formed

The World Wide Web Consortium (W3C)

W3C logo from W3C

A potted history of HTML standards

Date HTML standards Web browsers
1994 The W3C is formed Netscape release the Netscape Navigator browser and the web 'takes off'
1995 The HTML 2.0 standard is published But Netscape Navigator is 'ahead' of the standard
1995 The W3C starts work on HTML 3.0 and 3.1 The first version of Internet Explorer is released
The browser wars begin

A potted history of HTML standards

Date HTML standards Web browsers
Early 1997 The W3C publishes the HTML 3.2 standard Browsers diverge widely from the standard
Late 1997 The W3C publishes HTML 4.0, attempting to 'rein in' the browsers. (Minor changes are made in 1991 and 2001, the last version being HTML 4.01.)
1998 The Web Standards Project starts

The Web Standards Project (WaSP)

W3C logo from W3C

A potted history of HTML standards

Date HTML standards Web browsers
1998 The XML standard is published Internet Explorer triumphs in the browser wars. (But its market share has declined since 2004)
2000 The XHTML 1.0 standard is published. Browser support for the HTML & CSS standards grows throughout the period
2001 The XHTML 1.1 standard is published.

HTML 4.01

HTML 4.01

HTML 4.01 defines three variants:

Strict HTML 4.01
Deprecates and (in some sense) disallows most (but not all) presentational markup. Authors are expected to use CSS instead
Transitional HTML 4.01
Allows presentational markup in recognition of poor support for CSS at the time and in recognition of the large quantities of legacy web pages
Frameset HTML 4.01
Like Transitional, but supporting frameset in place of body. (Ignore!)

Telling a browser which variant you are using

At the very start of your document, include one of the following:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/html4/frameset.dtd">

Standards mode and quirks mode

The desire for extensibility

Extensible Markup Language (XML)

Example: a markup language for addresses

Example: a markup language for addresses

Example: a markup language for addresses

Example: a markup language for addresses

Example: a markup language for recipes

The Extensible HyperText Markup Language (XHTML)

Telling a browser which variant you are using

At the very start of your document, include one of the following:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">

In fact, this is what you should write

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html 
 PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
...
</html>

(And similarly for Transitional and Frameset)

What are the differences between HTML and XHTML

In XHTML,

What will we use?