472,989 Members | 2,995 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,989 software developers and data experts.

Anchors with name _and_ id?

Hi,

I have routinely added anchors to pages using both name and id:

<a name="example" id="example"></a>

under the possibly mistaken assumption that at some stage "name" might
be deprecated but "id" was unlikely to be.

Can I ask what is accepted practice currently?

Thanks for your trouble,

Andrew

--
Andrew's Corner
http://people.aapt.net.au/~adjlstrong/ubuntu_cli.html
Sep 13 '07 #1
4 2684
André Gillibert wrote:
Put the value in upper case letters.

<a name="EXAMPLE" id="EXAMPLE" href="URI">anchor text</a>

This is because the ID element type has a declared value of ID, while
the NAME element type has a declared value CDATA.
Values of attributes of declared value ID are case folded as specified
by the HTML SGML declaration which contains "NAMECASE GENERAL NO", but
CDATA values are never case folded.
But what about this?:

<http://www.w3.org/TR/html4/struct/global.html#adef-id>

id = name [CS]

i.e. ids are case-sensitive. Is it an error, or am I misinterpreting it?
For an extensive description of the issue, read:
https://www.cs.tcd.ie/15445/UG.HTML#FOLDING
--
ss at comp dot lancs dot ac dot uk |

Sep 13 '07 #2
In article <sl*******************@debranded.larseighner.com >,
Lars Eighner <us****@larseighner.comwrote:
In our last episode, <sl*******************@ilium.invalid>, the lovely and
talented andrew broadcast on comp.infosystems.www.authoring.html:
Hi,
I have routinely added anchors to pages using both name and id:
<a name="example" id="example"></a>
under the possibly mistaken assumption that at some stage "name" might
be deprecated but "id" was unlikely to be.

That name would be deprecated was announced with XHTML 1.0 and name
was deprecated for A and MAP in XHTML 1.1. Of course it is going to be in
HTML 4.x forever and XHTML is pretty much neither fish nor fowl so let's not
feed into that can of worms.
But not html 5...

http://www.w3.org/html/wg/html5/diff/#absent-attributes

"name attribute on map, img, object, form, iframe, a (use id instead)."
Sep 13 '07 #3
In our last episode,
<no****************************@news1.chem.utoront o.ca>,
the lovely and talented David Stone
broadcast on comp.infosystems.www.authoring.html:
In article <sl*******************@debranded.larseighner.com >,
Lars Eighner <us****@larseighner.comwrote:
>In our last episode, <sl*******************@ilium.invalid>, the lovely and
talented andrew broadcast on comp.infosystems.www.authoring.html:
Hi,
I have routinely added anchors to pages using both name and id:
><a name="example" id="example"></a>
under the possibly mistaken assumption that at some stage "name" might
be deprecated but "id" was unlikely to be.

That name would be deprecated was announced with XHTML 1.0 and name
was deprecated for A and MAP in XHTML 1.1. Of course it is going to be in
HTML 4.x forever and XHTML is pretty much neither fish nor fowl so let's not
feed into that can of worms.
But not html 5...
http://www.w3.org/html/wg/html5/diff/#absent-attributes
"name attribute on map, img, object, form, iframe, a (use id instead)."
Where is the DTD?

--
Lars Eighner <http://larseighner.com/ <http://myspace.com/larseighner>
Countdown: 495 days to go.
What do you do when you're debranded?
Sep 13 '07 #4
Hello,

Harlan Messinger wrote:
André Gillibert wrote:
>andrew wrote:
>>Hi,

I have routinely added anchors to pages using both name and id:

<a name="example" id="example"></a>

under the possibly mistaken assumption that at some stage "name" might
be deprecated but "id" was unlikely to be.

Put the value in upper case letters.

<a name="EXAMPLE" id="EXAMPLE" href="URI">anchor text</a>

This is because the ID element type has a declared value of ID,

It does not. First, you mean "type", not "value",
André is right: it is called "declared value". This may be confusing,
because it is similar to the "type" in programming languages, but the SGML
spec uses "declared value".
and second, the type
of the id attribute is "name".

http://www.w3.org/TR/html4/struct/global.html#h-7.5.2
André refers to the HTML DTD. The HTML spec uses 'type' scheme on top of the
SGML rules, but a real SGML parser does not know about that.
>while
the NAME element type has a declared value CDATA.

Values of attributes of declared value ID are case folded as specified
by the HTML SGML declaration which contains "NAMECASE GENERAL NO", but
CDATA values are never case folded.

Semantically, id="example" is strictly equivalent to id="EXAMPLE" and an
HTML filter may apply such a case folding. However, name="example" isn't
equivalent to name="EXAMPLE".

http://www.w3.org/TR/html4/types.html#h-6.1

This is untrue. Both attributes are marked "[CS]" (case sensitive), and
id="EXAMPLE" is not the same as id="example".
It is case sensitive on the 'HTML level', which is one step above SGML. A
SGML parser *does* fold id="example" into id="EXAMPLE" - HTML rules cannot
change that. HTML will then treat this uppercased string case sensitive.
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://pink.odahoda.de/
Sep 13 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Ben Wilson | last post by:
To anyone who can help me, you have my thanks in advance. I am implementing a "301 Moved Permanently" redirect in my website due to a change of our domain names. Unfortunately, I am having a...
2
by: mlv2312 | last post by:
Hi, I have experienced problems when dealing with nested anchors. I implemented some code to perform highlighting and specific anchors are used for the searched words. The problem is when the...
1
by: mlv2312 | last post by:
Hi, I have experienced problems when dealing with nested anchors. I implemented some code to perform highlighting and specific anchors are used for the searched words. The problem is when the...
2
by: learner | last post by:
Hi, A document has many Anchors. I want to take a particular action only if some particular anchors are clicked. I mean if some anchors are clicked, i want an alert box to pop up with ok and...
21
by: adrian suri | last post by:
Hi just started to experement with styleshhets, and have defined hover a:hover { Color : red; Text-decoration : none; Border-top-width : medium; Border-right-width : medium;
12
by: Rich | last post by:
Strangely, on-page anchors will work on MSIE, but not on Netscape7.2 or Firefox1.5. All anchors are numbers e.g. <a href="#21">TOPIC</a> supposed to connect down to <a name="#21>beginning of...
17
by: Crimperman | last post by:
Hi, need some advice on URIs In a dynamic page (perl driven) we list a number of items presented in an hierarchical tree structure. Within that page is a form which allows you to search for...
1
by: Alec MacLean | last post by:
Hi. I'm using VS2005 Pro to work on a website project for my company. The site has several navigation elements, all based on the standard VS2005 navigation components. I have high-level...
3
by: windandwaves | last post by:
does it matter if I write var anchors = document.getElementsByTagName("A"); or var anchors = document.getElementsByTagName("a"); Or is there a better way to catch both <a hrefs and <A...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
3
SueHopson
by: SueHopson | last post by:
Hi All, I'm trying to create a single code (run off a button that calls the Private Sub) for our parts list report that will allow the user to filter by either/both PartVendor and PartType. On...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.