Re: When is something a tag?

Robert wrote:

> I like to know when something is a tag.
> For example <p> is a tag, but < p> is not (usually displayed as text).
>
> 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).
> Or is there no formal definition? And do browsers implement its own 
> ideas of when something is a tag?

You are correct in that you have to consult those specifications.

For XHTML there is the XML specification:
http://www.w3.org/TR/REC-xml/

The rules for tags in SGML are similar, as XML is based on SGML.

The grammar of an element in XML can e.g. be found here:
http://www.w3.org/TR/REC-xml/#sec-starttags

STag ::= '<' Name (S Attribute)* S? '>'

Where S means whitespace, and a ? means that the token before it is 
optional (in this case, the whitespace), and * that the token before it 
can occur zero or more times (in this case, the whitespace + attribute 
group).


~Grauw

-- 
Ushiko-san! Kimi wa doushite, Ushiko-san!!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Laurens Holst, student, university of Utrecht, the Netherlands.
Website: www.grauw.nl. Backbase employee; www.backbase.com.

Received on Monday, 20 June 2005 10:37:55 UTC