W3C home > Mailing lists > Public > www-validator@w3.org > December 2001

Re: use of name and id in XHTML frame element

From: Peter K. Sheerin <pete@petesguide.com>
Date: Mon, 3 Dec 2001 11:03:26 -0800
Message-ID: <002501c17c2d$30d93b80$dd10960a@CADENCESHEERIN>
To: "Jim Isaak" <j.isaak@computer.org>, <www-validator@w3.org>
You have to be careful with name and id. Name is indeed depricated, but that
doesn't mean it's not valid in XHTML documents. It is left in the spec to
support older, broken browsers that don't fully support HTML 4.01 (this
means Netscape 4.x and below, which don't recognize "id" as a valid target).

Because of that, it is a good idea to use both id and name, but you have to
be careful when doing so, since just about any tag in XHTML can take the id
attribute, but only some of them can take the name attribute. This may
necessitate the use of an empty anchor (<a name="fubar" id="fubar"></a>) if
you need to tag something that doesn't support the name attribute.

Not sure how all this interacts with the name attributes on framesets, but
you do want to make sure that you test the code against the validator, and
test its operation in both modern browsers and older ones (Netscape 4.x
specifically), to make sure it actually works. I had a hyperlink on one of
my sites for about two weeks that worked fine in IE on the desktop, but I
couldn't figure out why it wasn't working in Pocket IE on my Pocket  PC,
until I discovered that it didn't work in Netscape 4.x either, and I
remembered that Pocket IE is a 4.x class browser, which doesn't support HTML
4.01...

----- Original Message -----
From: "Jim Isaak" <j.isaak@computer.org>
To: <www-validator@w3.org>
Sent: Thursday, November 29, 2001 7:18 AM
Subject: use of name and id in XHTML frame element


> I'm using validator as part of my web design
> classes, and the example below as a question
> on "well-formed" vs "valid" vs "legal" for
> XHTML frameset DTD.  (when enclosed in
> <?xml, <!DOCTYPE, <html xmlns... tags.)
> It is well formed and illegal (copyright issue)
> but is it valid? ... following the lead in Dave
> Ragget's book (WROX, Beginning XHTML, pg197)
> the "name" attribute is deprecated, and "id"
> attribute the correct way to indicate the
> frame name.  However, it validates as "OK"
> with validator (using "name" but not "id").
>
> Should ID be required if name is included?
> (Please respond to me directly since I've not
> joined the reflector. -- thanks.)
> =============
> <frameset rows="64,*">
>    <frame   name="banner" scrolling="no"
>          noresize="noresize" src="MyAds.htm" />
>    <frameset cols="150,*">
>       <frame name="contents" scrolling="auto"
> src="MyIndex.htm" />
>       <frame name="body" scrolling="auto"
> src="http://www.newyorktimes.com" />
>    </frameset>
> </frameset>
> ==============
>
> --
> Jim Isaak
> Internet/Standards Strategist
> +-----------------------------------------------
> J.Isaak@Computer.org http://www.JimIsaak.com
> Candidate for the IEEE Board of Directors:
>    www.ieee.org/organizations/corporate/divVIII.htm
> Chair: Internet Best Practices Standards Committee
>    http://computer.org/standards/Internet
> +-----------------------------------------------
>
>
>
>
Received on Monday, 3 December 2001 14:03:56 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 25 April 2012 12:14:00 GMT