34531

Internet Technologies
and Their Applications
home

Document Type Declaration

The whole idea behind having a dtd at the beginning of a web document is to make life really easy for the web browser. When a dtd is specified, the browser should know exactly what's allowed in the document, and the parsing of the document gets very much easier than if the parsing has to take into account a whole lot of possible errors and exceptions.

The following DTDs are in common use:

html 4.01

The html document is based upon a subset of sgml

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

xhtml 1.0

xhtml is a re-formulation of html as a xml document

<!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 Strict//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">

xhtml 1.1

With xhtml 1.1 wc3 has taken a step further and has modularised the whole thing.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
        "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

home