473,796 Members | 2,573 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Name attribute for anchor doesn't validate

I have a document with a set of internal links such as:

<a name="Z1"></a>...
<a name="Z2"></a>...

The W3C validator objects to the first instance of the name attribute:
There is no attribute "FOO" for this element (in this HTML
version). The element is defined not to have this attribute.

These anchors are not contained in anything. For example, the Z1
anchor context is actually:

...
</ul>
<hr />
<a name="Z1"></a>
<h2>Title</h2>
<dl>
...

The error is triggered only by the first instance of the name
attribute, and so not by anchors Z2, Z3, ...

My doctype is xhtml11, and my browser is galeon. In my stylesheet,
the a element is defined only with regard to its pseudo-elements.

If I change the first statement to:

<a id="Z1"></a>...

Then the error is triggered by the Z2 anchor, etc.

--
Haines Brown
br****@hartford-hwp.com
kb****@arrl.net
www.hartford-hwp.com

Jul 20 '05
22 4764
On Wed, Sep 10, Jim Ley inscribed on the eternal scroll:
I'd say if an author was so misguided as to give IE a XHTML doctype
when it's an HTML user agent, then the user is almost certainly
wanting quirks mode, since they're almost certainly not using XHTML
for appropriate reasons.


I suppose statistically you might very well be right: the proportion
of us who have been trying to use HTML in accordance with published
specifications has been relatively small. But just wait: the
supporters of Sturgeons Law are already propagating their quasi-XHTML
tag soup - soon there will be no hiding from it there either.
Jul 20 '05 #21
On Wed, 10 Sep 2003 15:02:12 GMT, Haines Brown
<br****@hartfor d-hwp.com> wrote:
Then Jim L. appears to suggest thay by identifying a doctype as XHTML,
the IE "HTML user agent" will naturally be quirky. Does this mean
simply that IE does not handle XHTML docs reliably?
IE makes no claims to support XHTML, it renders XHTML as if it was
HTML tag-soup, you're getting lucky with its tag-soup parser. In fact
all the major browsers when they get XHTML served as text/html are
treating it as tag-soup, so you're just getting lucky.
1. XHTML is a threat to reliable browser performance, and so one
should use HTML unless there's good reason not to.
Yes, if the XHTML is served as text/html, not if XHTML is served as
application/xhtml+xml
2. If one uses XHTML, the char set specification should appear only in
the content-type meta statement and not in the document preface
(material before the <head> container). To have it in both places
might cause IE misbehavior.
No, it should only appear in the mime-type text/html; charset=x-foo
3. IE unreliability is likely to increase because MS is unable or
unwilling to improve it in order to display XML documents reliably.


IE is not an XHTML user agent, IE has no reason to become an XHTML
user agent until people start serving XHTML documents, if you tell it
you've got an HTML doc, and then give it some tag-soup, don't be
surprised that it doesn't do exactly what you expect.

text/html is not an XML mime-type, so it should not be doing XML
things with it - serve it as application/xml and IE will do an
appropriate thing with your document.

Jim.
--
comp.lang.javas cript FAQ - http://jibbering.com/faq/

Jul 20 '05 #22
On Wed, Sep 10, Jim Ley inscribed on the eternal scroll:
On Wed, 10 Sep 2003 15:02:12 GMT, Haines Brown
<br****@hartfor d-hwp.com> wrote:
2. If one uses XHTML, the char set specification should appear only in
the content-type meta statement and not in the document preface
(material before the <head> container). To have it in both places
might cause IE misbehavior.
No, it should only appear in the mime-type text/html; charset=x-foo


The questioner might need to be told explicitly that this is part
of the HTTP transaction response header, per RFC2616, and has nothing
at all to do with the HTML <head> container which, as far as HTTP is
concerned, is part of the "response body".

See e.g
http://www.w3.org/Protocols/rfc2616/....html#sec14.17
IE is not an XHTML user agent, IE has no reason to become an XHTML
user agent until people start serving XHTML documents, if you tell it
you've got an HTML doc, and then give it some tag-soup, don't be
surprised that it doesn't do exactly what you expect.


I've learned not to expect it to conform with published interworking
requirements either, so if I ever send it properly-conforming HTML and
it does the right thing then it's a pleasant surprise...

But I agree with your bottom-line conclusion: sending out conforming
HTML currently offers the best chance of success, and as the only
other "compatible-in-practical-terms" option on offer is Appendix C
XHTML/1.0, which is functionally identical to HTML/4.01 just with
XML-ised syntax, then HTML/4.01 seems the practical choice for
real-world deployment. By all means choose (or migrate towards) the
"Strict" variant, using CSS to propose the presentation - this is a
good move irrespective of the choice between HTML and XHTML.

And what you do on the lab bench is something else entirely, but
probably not ready for real-world deployment except with a known
specialist audience who has a specific need for the features (be they
MathML, SVG or whatever) and resulting willingness to acquire whatever
it takes to view them.

cheers
Jul 20 '05 #23

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

Similar topics

21
11388
by: TheKeith | last post by:
I heard that the name attribute is deprecated in html 4.01 strict. Is it recommended that you use the ID attribute for images along with the getElementById method instead of the old way? Thanks.
5
5771
by: Neville310 | last post by:
I have a few questions about the name attributes and href referencing to. Can you declare name attributes for tags other than anchor elements (like div or h2)? The validator keeps returning the following error for HTML 4.0 strict . Line 139, column 12: there is no attribute "NAME" <h2 name="heading">H2 Headline </h2> | You have used the attribute named above in your document, but the document type | you are using does not support...
6
1359
by: Richard | last post by:
<a href="#" name="sample">link 1</a> <a href="#" name="sample">link 2</a> Would this be invalid use of the name? If I wanted to have a function that would be acted upon by detection of the "name", would this happen if all "name"s in a group were the same? I know ID can only be used once per document, what about "name"? If this is invalid, then if I went by a unique ID, such as sample1, sample2, sampl3, is there a way to eliminate the...
4
5038
by: catyionic | last post by:
Greetings: I have numerous links on index.html...example of one..... <A HREF="stage.html#Flash" target="left">Flash</A> It connects to page named stage.html ... which contains... <a name="#FLASH">Flash ...</a></td> It presents the data in the middle of index in an Inline frame. It works real well, looks good, but everytime the link is clicked, the
30
2845
by: Mason A. Clark | last post by:
This seems too simple by I can't find the answer. Must <a name="foo"> be closed with </a> ? Must it have content? W3C says the content cannot be block so what if : <a name="foo"> <h2>Foo Is Good</h2> ( a likely location )
5
1793
by: Alex Maghen | last post by:
The editor says that when using <a name="xyz" />, the "name" element is "obsolete" but it doesn't suggest a replacement. What's wrong with <a name="xyz" /> to set a page anchor?
2
2009
by: TheDrizzle | last post by:
Hey All, I am using ADF UIX, which is a Oracle Framework to develop a web application. It is based off XML and translates the XML to HTML upon execution. The problem I'm having is it is creating some anchors I need to access in JavaScript without a name or ID attribute. There is also no way in the XML i can assign these objects a name or ID. For example, I have this <dateField> xml tag I create. This renders on the HTML page as a input...
6
2311
by: Dick Watson | last post by:
I had a page that works when setup like this: === <form name="frmCalc" action=""> <script type="text/javascript"> function btnCalc_onclick(abc) { return "got here with " + abc; }
3
1459
by: idorjee | last post by:
Hi, Can anyone please tell me if there is a way to hyperlink to a web page which doesn't have the anchor "name" attribute (e.g., <a name="thename">), but has tags such as, <strong>. So, my question is, is it possible to hyperlink to a tag? The only way that I know is the following: <a href="http://thepage.com/example.html#thename">The Web Link</a> Thanks a lot in advance.
0
9530
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10459
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10182
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10017
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7552
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5445
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4120
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3734
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2928
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.