broken URI fragments (such as index.html#fragment)

Charles Curley charlescurley at charlescurley.com
Fri Apr 3 17:50:30 MDT 2009


On Thu, Apr 02, 2009 at 10:44:32PM -0400, Justin Hileman wrote:

>
>
> RFC2396 (URI generic syntax) says that fragments refer to ID type  
> attributes. In HTML 4 and XHTML, this is the "id" attribute, not "name".  
> I.E. you don't actually have a target for that link, because there's no  
> anchor with that id. For backwards compatibility you can still browse to  
> an anchor via "name", but it's not XHTML strict. Since your page  
> declares a XHTML strict doctype, I imagine the validator is explicitly  
> looking for the id.
>
> It will still work with "name", and will prob'ly always work that way.  
> If you want to validate links and/or make things future proof, you  
> should add an id to your anchors, e.g:
>
> <h2><a id="TOC130" name="TOC130">Acknowledgments</a></h2>
>
> See the XHTML 1.0 compatibility guidelines:
>
> http://www.w3.org/TR/xhtml1/guidelines.html#C_8

Thanks, that explains it quite well.

Except.... I modified my script to produce the output exactly as you
and the document suggested. I put that on the server, and then read
the source to verified that it got there. And the W3C's link checker
still says it's broken. Caching issue?

To test that theory I installed it locally ("aptitude install
w3c-linkchecker"), and ran that. The local version reports no broken
fragment errors.

Curiouser and curiouser, as Alice would say.

-- 

Charles Curley                  /"\    ASCII Ribbon Campaign
Looking for fine software       \ /    Respect for open standards
and/or writing?                  X     No HTML/RTF in email
http://www.charlescurley.com    / \    No M$ Word docs in email

Key fingerprint = CE5C 6645 A45A 64E4 94C0  809C FFF6 4C48 4ECD DFDB
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://plug.org/pipermail/plug/attachments/20090403/9dd34b1e/attachment.bin 


More information about the PLUG mailing list