banner
Welcome to HTML.co.uk, the number one resource for all news, information, and happenings regarding HTML.

Updates: HTML.co.uk has just been relaunched. Subscribe to our RSS Feed to stay on top of HTML news and techniques.
Jul
16th

Classification of HTML

Author: Editor | Files under HTML Tutorials
Tags for this article: , , , , ,

HTML can be classified into two categories namely SGML based HTML (traditional) pitted against XML based HTML (also called XHTML) and the second one being a strict versus transitional versus frameset. In this article, the former has been described in detail.

One notable difference between the traditional version and XHTML is the technical distinction between the two of them. However, Inspite of all the modifications being done, the root element name “HTML” has been kept the same. The area which requires loads of effort is the one where the limitations of XML start showing in comparison to the more complex SGML inspite of the W3C intended HTML 4.01 being identical to XHTML 1.0. Due to the similarity quotient between HTML and XHTML, they are documented in parallel at many times.

The difference between an XHTML 1.0 document and an HTML 4.01 document is mostly syntactic in each of the corresponding DTDs except for the different opening declarations applicable for the document. There are many shortcuts which XHTML does not allow but HTML allows because of the underlying syntax. Be it elements with optional opening or closing tags, empty elements not having an end tag, all these are examples of the shortcuts that a user can take advantage of in HTML. HTML requires all elements to have an opening tag or a closing tag.

After contemplating on the whole process, the developers of XHTML have also come out with a shortcut. The opening and closing of an HTML tag has to be done within the same tag but a slash (/) can be added before the closing of the tag. For demonstration of the concept, let us take this example: <avi/>, where “<” is the opening tag and “>” the closing tag, “avi” is a fictitious HTML tag and as mentioned above, the slash (/) comes before the tag is closed.

To properly understand the minute differences between HTML and XHTML, the tips listed below need to be kept in mind:

. XHTML makes use of XML’s built in language defining functionality attribute. The language for an element should be specified with a lang attribute rather than the XHTML attribute.
. The XML namespace has to be removed as HTML does not have a provision for namespaces.
. The document type declaration has to be changed from XHTML 1.0 to HTML 4.01.
. The empty-element syntax of an XML has to be developed into a style empty element of an HTML.

A technically well constructed XHTML document will always follow all the syntax requirements of XML. The structure of a document is thoroughly described by the content of XHTML and legitimate documents will religiously follow its specified data.

To migrate easily between HTML and XHTML, several conventions have been recommended by the W3C and by meticulously following these guidelines, a user will be able to easily interpret the document as HTML or XHTML. The XHTML 1.0 documents that have been made compatible in this way are permitted by the W3C to be served either as HTML or as XHTML.