httpd-docs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe, Jr." <wr...@rowe-clan.net>
Subject Re: Trailing slashes in HTML tags?
Date Thu, 28 Jun 2001 03:03:08 GMT
Once again, I blew it.  Yes, the XML syntax is <p>...</p> for a balanced tag pair,
and <hr/> for an 'unbalanced' tag.  Since <hr/> is definately NOT legal HTML,
the
<hr /> syntax was adopted, it is a legal unbalanced XML tag, and is also legal HTML.

An HTML parser looks at <hr /> and says, ok, this is an HR tag (it groks this),
with a "/" attribute, which it can't grok.  Anything that HTML/XML etc cannot
understand, they are requried to ignore.  So <HR /> is the same as <HR>, and both
are legal HTML.  Only <HR /> is legal XML.

Same is true with a longer tag, such as <IMG SRC="foo.gif" /> ... html parsers don't
grok the / and throw it away, but they will process the SRC attribute.


----- Original Message ----- 
From: "Jason Lingohr" <jason@lucid.net.au>
To: <apache-docs@apache.org>; "William A. Rowe, Jr." <wrowe@rowe-clan.net>
Sent: Wednesday, June 27, 2001 9:18 PM
Subject: Re: Trailing slashes in HTML tags?


> On Wed, Jun 27, 2001 at 10:36:48AM -0500, William A. Rowe, Jr. wrote:
> 
> > My mistake, try that again...
> > 
> > <p/>test</p> is illegal for all older parsers.
> > 
> > <p />test</p> is legal for all older parsers, and the '/' keyword is
ignored.
> > 
> > Bill
> 
> Ok, but what about this case (from index.html.en):
> 
> <hr width="50%" size="8" />
> <div align="center"><img src="apache_pb.gif" alt="" /></div>
> 
> 
> 
> --
> ----------------------------------------------------------------------------
> Jason Lingohr
> jason@lucid.net.au
> ----------------------------------------------------------------------------
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: apache-docs-unsubscribe@apache.org
For additional commands, e-mail: apache-docs-help@apache.org


Mime
View raw message