Cari di HTML4 
    HTML 4
Daftar Isi
(Sebelumnya) 18. Scripts20. SGML Declaration of HTML 4 (Berikutnya)

19. SGML reference information forHTML

The following sections contain the formal SGML definition of HTML 4. Itincludes the SGML declaration, the Document Type Definition (DTD), and the Character entity references, as well as a sample SGMLcatalog.

These files are also available in ASCII format as listed below:

Default DTD:
strict.dtd
Transitional DTD:
loose.dtd
Frameset DTD:
frameset.dtd
SGML declaration:
HTML4.decl
Entity definition files:
HTMLspecial.ent
HTMLsymbol.ent
HTMLlat1.ent
A sample catalog:
HTML4.cat

19.1 DocumentValidation

Many authors rely on a limited set of browsers to check on the documentsthey produce, assuming that if the browsers can render their documents they arevalid. Unfortunately, this is a very ineffective means of verifying adocument's validity precisely because browsers are designed to cope withinvalid documents by rendering them as well as they can to avoid frustratingusers.

For better validation, you should check your document against an SGML parsersuch as nsgmls (see [SP]), to verify that HTML documents conform to the HTML 4 DTD. If the document type declaration of yourdocument includes a URI and your SGML parser supports this type of systemidentifier, it will get the DTD directly. Otherwise you can use the followingsample 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 parseris capable of handling [ISO10646]. Seeyour validation tool documentation for further details.

Beware that such validation, although useful and highly recommended, doesnot guarantee that a document fully conforms to the HTML 4 specification. Thisis because an SGML parser relies solely on the given SGML DTD which does notexpress all aspects of a valid HTML 4 document. Specifically, an SGML parserensures that the syntax, the structure, the list of elements, and theirattributes are valid. But for instance, it cannot catch errors such as settingthe width attribute of an IMG element to an invalid value (i.e., "foo" or "12.5"). Althoughthe specification restricts the value for this attribute to an "integerrepresenting a length in pixels," the DTD only defines it to be CDATA, which actually allows any value. Only aspecialized program could capture the complete specification of HTML 4.

Nevertheless, this type of validation is still highly recommended since itpermits the detection of a large set of errors that make documents invalid.

19.2 Sample SGML catalog

This catalog includes the override directive to ensure that processingsoftware such as nsgmls uses public identifiers in preference to systemidentifiers. This means that users do not have to be connected to the Web whenretrieving URI-based system identifiers.

OVERRIDE YESPUBLIC "-//W3C//DTD HTML 4.01//EN" strict.dtdPUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" loose.dtdPUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" frameset.dtdPUBLIC "-//W3C//ENTITIES Latin1//EN//HTML" HTMLlat1.entPUBLIC "-//W3C//ENTITIES Special//EN//HTML" HTMLspecial.entPUBLIC "-//W3C//ENTITIES Symbols//EN//HTML" HTMLsymbol.ent
Copyright © 1997-1999 W3C® (MIT, INRIA, Keio), All Rights Reserved.
(Sebelumnya) 18. Scripts20. SGML Declaration of HTML 4 (Berikutnya)