Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
October 19, 2004, 10:37 pm
rate this thread
Apologies if this is an FAQ.
I'm tearing my hair out trying to get around this one.
I have a site which uses different stylesheets for accessibility than
passing the stylesheet using a query string. (Actually, it's a tad
more complicated than that; I'm passing the stylesheet to use in an
ampersand, rather than a "proper" query string. this is because I'm
using Apache's RewriteRules to build a query string based on a '/'
separated list in the URL, and tagging the css part at the end.
Since I'm tryting to code for accessibility, I want to add <LINK> tags
which will be picked up by browsers which can understand them (e.g.
Opera but especially voicereaders such as JAWS).
The LINK tags I am using are of the form:
When clicked, the RewriteRules change the href to:
and as far as the browser is concerned, everything is fine and dandy.
However, when I try to validate the page using the W3C validator at
http://validator.w3c.org it chokes on the LINK tag, giving the error
"You have used character data somewhere it is not permitted to
appear. Mistakes that can cause this error include putting text
directly in the body of the document without wrapping it in a
container element (such as a <p>aragraph</p>) or forgetting to quote
an attribute value (where characters such as "%" and "/" are common,
but cannot appear without surrounding quotes)."
I *could* change the method used, e.g. instead of using an & use
another character (such as ".") which isn't required to use an entity
and then change the RewriteRules to convert this to "&", but that
would just confuse the search engines, as they would follow any other
links which specified a different stylesheet. Incidentally, the above
syntax works fine in <A ...> anchor tags, it's only in LINK tags that
Can anyone tell me what I'm doing wrong?
Curiosity *may* have killed Schrodinger's cat.
Re: Accessibility and Validating LINK tags containing "&"
Without a URL, it's hard to say, but chances are you're using XHTML
syntax on an HTML page. Try:
"Never drink rum&coke whilst reading usenet" - rf 2004
- » CSS based horizontal menu bar, need help as not working in Opera & Mac/IE
- — Previous thread in » HTML Markup Language