Re: When is something a tag?

> I like to know when something is a tag.
> For example <p> is a tag, but < p> is not (usually displayed as text).

A conforming XHTML processor should abort on encountering < p>.  Note
that IE isn't a conforming XHTML processor, but rather an HTML processor
with some special error recovery to cope with XHTML served as HTML.
(< isn't allowed in text and < space doesn't match the production for
a tag, so a document containing this wouldn't match the production for
an XML document, which is one of the conditions for it being not
well formed.)

> I would like to know if the definition of when it is a tag is defined by 
> a version of (X)HTML, or if this is defined by SGML (for HTML) or XML 
> (for XHTML).

Both the HTML and XML specifications are available for free download,
so you can check for yourself.  For HTML browsers only loosely follow
the specfication, otherwise XML constructs like <br /> would fail in
HTML.

Received on Monday, 20 June 2005 20:05:19 UTC