Home /Modules/html-spec/intro.html

intro.html

html-spec/specifications/prose/html-4.01/sgml/intro.html · 146 line(s) · html

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>SGML reference information for HTML</title>
<link rel="previous" href="../interact/scripts.html">
<link rel="next" href="sgmldecl.html">
<link rel="contents" href="../cover.html#toc">
<link rel="stylesheet" type="text/css" href= 
"http://www.w3.org/StyleSheets/TR/W3C-REC">
<link rel="STYLESHEET" href="../style/default.css" type="text/css">
</head>
<body>
<div class="navbar" align="center">&nbsp;<a href="../interact/scripts.html">
previous</a> &nbsp; <a href="sgmldecl.html">next</a> &nbsp; <a href= 
"../cover.html#minitoc">contents</a> &nbsp; <a href="../index/elements.html">
elements</a> &nbsp; <a href="../index/attributes.html">attributes</a> &nbsp; <a
href="../index/list.html">index</a> 

<hr></div>

<h1 align="center"><a name="h-19">19</a> SGML reference information for
HTML</h1>

<div class="subtoc">
<p><strong>Contents</strong></p>

<ol>
<li><a class="tocxref" href="#h-19.1">Document Validation</a></li>

<li><a class="tocxref" href="#h-19.2">Sample SGML catalog</a></li>
</ol>
</div>

<p>The following sections contain the formal SGML definition of HTML 4. It
includes the <a href="sgmldecl.html">SGML declaration</a>, the <a href=
"dtd.html">Document Type Definition</a> (DTD), and the <a href="entities.html">
Character entity references</a>, as well as a <a href="#catalog">sample SGML
catalog</a>.</p>

<p>These files are also available in ASCII format as listed below:</p>

<dl>
<dt><strong>Default DTD:</strong></dt>

<dd><a href="../strict.dtd">strict.dtd</a></dd>

<dt><strong>Transitional DTD:</strong></dt>

<dd><a href="../loose.dtd">loose.dtd</a></dd>

<dt><strong>Frameset DTD:</strong></dt>

<dd><a href="../frameset.dtd">frameset.dtd</a></dd>

<dt><strong>SGML declaration:</strong></dt>

<dd><a href="../HTML4.decl">HTML4.decl</a></dd>

<dt><strong>Entity definition files:</strong></dt>

<dd><a href="../HTMLspecial.ent">HTMLspecial.ent</a>
<br>
<a href="../HTMLsymbol.ent">HTMLsymbol.ent</a>
<br>
<a href="../HTMLlat1.ent">HTMLlat1.ent</a></dd>

<dt><strong>A sample catalog:</strong></dt>

<dd><a href="../HTML4.cat">HTML4.cat</a></dd>
</dl>

<h2><a name="h-19.1">19.1</a> <span class="index-inst" title="document::SGML 
validation|SGML::document validation"><a name="idx-document">Document
Validation</a></span></h2>

<p>Many authors rely on a limited set of browsers to check on the documents
they produce, assuming that if the browsers can render their documents they are
valid. Unfortunately, this is a very ineffective means of verifying a
document's validity precisely because browsers are designed to cope with
invalid documents by rendering them as well as they can to avoid frustrating
users.</p>

<p>For better validation, you should check your document against an SGML parser
such as nsgmls (see <a href="../references.html#ref-SP" class="informref">
[SP]</a>), to verify that HTML documents conform to the HTML 4 DTD. If the <a
href="../struct/global.html#version-info">document type declaration</a> of your
document includes a URI and your SGML parser supports this type of system
identifier, it will get the DTD directly. Otherwise you can use the following
sample SGML catalog. It assumes that the DTD has been saved as the file
"strict.dtd" and that the entities are in the files "HTMLlat1.ent",
"HTMLsymbol.ent" and "HTMLspecial.ent". In any case, make sure your SGML parser
is capable of handling <span class="index-inst" title="document character 
set::ISO10646"><a name="idx-document_character_set" rel="biblioentry" href= 
"../references.html#ref-ISO10646" class="informref">[ISO10646].</a></span> See
your validation tool documentation for further details.</p>

<p>Beware that such validation, although useful and highly recommended, does
not guarantee that a document fully conforms to the HTML 4 specification. This
is because an SGML parser relies solely on the given SGML DTD which does not
express all aspects of a valid HTML 4 document. Specifically, an SGML parser
ensures that the syntax, the structure, the list of elements, and their
attributes are valid. But for instance, it cannot catch errors such as setting
the <a href="../struct/objects.html#adef-width-IMG" class="noxref"><samp class= 
"ainst-IMG">width</samp></a> attribute of an <a href= 
"../struct/objects.html#edef-IMG" class="noxref"><samp class="einst">
IMG</samp></a> element to an invalid value (i.e., "foo" or "12.5"). Although
the specification restricts the value for this attribute to an "integer
representing a length in pixels," the DTD only defines it to be <a href= 
"../types.html#type-cdata">CDATA</a>, which actually allows any value. Only a
specialized program could capture the complete specification of HTML 4.</p>

<p>Nevertheless, this type of validation is still highly recommended since it
permits the detection of a large set of errors that make documents invalid.</p>

<h2><a name="h-19.2">19.2</a> <span class="index-inst" title="SGML::catalog for 
HTML|catalog for HTML"><a name="catalog">Sample SGML catalog</a></span></h2>

<p>This catalog includes the override directive to ensure that processing
software such as nsgmls uses public identifiers in preference to system
identifiers. This means that users do not have to be connected to the Web when
retrieving URI-based system identifiers.</p>

<div class="dtd-fragment">
<pre>
OVERRIDE YES

PUBLIC "-//W3C//DTD HTML 4.01//EN" strict.dtd
PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" loose.dtd
PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" frameset.dtd
PUBLIC "-//W3C//ENTITIES Latin1//EN//HTML" HTMLlat1.ent
PUBLIC "-//W3C//ENTITIES Special//EN//HTML" HTMLspecial.ent
PUBLIC "-//W3C//ENTITIES Symbols//EN//HTML" HTMLsymbol.ent
</pre>
</div>

<div class="navbar" align="center">
<hr><a href="../interact/scripts.html">previous</a> &nbsp; <a href= 
"sgmldecl.html">next</a> &nbsp; <a href="../cover.html#minitoc">contents</a>
&nbsp; <a href="../index/elements.html">elements</a> &nbsp; <a href= 
"../index/attributes.html">attributes</a> &nbsp; <a href="../index/list.html">
index</a></div>
</body>
</html>