q tag question

liunx

Guest
I am attempting to use XHTML 1.1 on my website. On this website, I have a few quotes, for which I have been using<br />
<br />
<q lang="en-us">You'd better be prepared for the jump into hyperspace. It's unpleasently like being drunk.</q><br /><br />
<q lang="en-us">What's so unpleasent about being drunk?</q><br /><br />
<q lang="en-us">You ask a glass of water.</q><br /><br />
<br />
This seemed to be working just fine in XHTML 1.0. The use of lang is part of the HTML 4.01 recommendation and does not seem to be deprecated. The problem is, when I try to validate my code, I get an error:<br />
<br />
Line 63, column 20: there is no attribute "lang" (explain...).<br />
<br />
<q lang="en-us">You'd better be prepared for the jump into hyperspac<br />
<br />
Anybody have any ideas why this is? I have found nothing in the XHTML 1.1 recommendation about this.<!--content-->Is the validator giving an error for EVERY occurence of "lang"? In other words, giving an error for each of the three times it's occuring in the sample?<br />
<br />
Neil<!--content-->No, actually. I hadn't thought about that. That is they only error it finds on the page. I thought that it was supposed to point out every incidence of an error. Of course, I still have no idea why it is just pointing out that one instance.<br />
<br />
Click here (<!-- m --><a class="postlink" href="http://validator.w3.org/check?uri=http://www2.kettering.edu/~good3001/index.html">http://validator.w3.org/check?uri=http: ... index.html</a><!-- m -->) to see the error.<!--content-->For some errors the validator only points out the first place that error occurs. You do revalidate after fixing an error, don't you? (I expect a lot of people get caught out by that).<br />
<br />
Hmm, the validator site was updated yesterday. It has a complete new front end, and works a bit differently. It isn't as good as the old site in some ways. It is possible that there are bugs in the system.<br />
<br />
However in this case I have looked to see if lang is a valid attribute of the q tag, and I cannot find the answer to that one.<!--content-->You do revalidate after fixing an error, don't you? (I expect a lot of people get caught out by that).<br />
I always revalidate. Well, I do now, anyway. I learned that lesson the hard way quite some time ago.<br />
Hmm, the validator site was updated yesterday. It has a complete new front end, and works a bit differently. It isn't as good as the old site in some ways. It is possible that there are bugs in the system.<br />
I think I like the old one better, as well. A bug is the only thing I can think of for this one, unless I am completely misunderstanding XHTML. If I understand correctly, anything no deprecated in HTML 4.01 should not be deprecated in XHTML 1.1. According to HTML 4.01 (<!-- m --><a class="postlink" href="http://www.w3.org/TR/html401/">http://www.w3.org/TR/html401/</a><!-- m -->), the lang (<!-- m --><a class="postlink" href="http://www.w3.org/TR/html401/struct/dirlang.html#adef-lang">http://www.w3.org/TR/html401/struct/dir ... #adef-lang</a><!-- m -->) attribute is a valid part of the Q (<!-- m --><a class="postlink" href="http://www.w3.org/TR/html401/struct/text.html#h-9.2.2">http://www.w3.org/TR/html401/struct/text.html#h-9.2.2</a><!-- m -->) element.<br />
<br />
After reading up a bit more on the lang attribute, I can see that it is inherted, so really isn't necessary in this case, since I use English throughout the document and that is declared in the HTML tag. I suppose that means I can take the offensive attribute out of the offended tag, but that really doesn't change the fact that the validator is seeing an error when there really isn't one.<!--content-->Try one more thing. You have the lang attribute on three different lines. Remove it from only the first line, and revalidate. Do you get an error for the second line, or no error?<br />
<br />
I also got caught out by the need to revalidate after fixing an error. Seems an easy enough thing to overlook.<!--content-->After removing the first lang="en-us", I get an error (<!-- m --><a class="postlink" href="http://validator.w3.org/check?uri=http://www2.kettering.edu/~good3001/index.html">http://validator.w3.org/check?uri=http: ... index.html</a><!-- m -->) on the second occurance.<!--content-->Given that it is inherited I'd just dump it as you suggested earlier.<br />
<br />
Neil<!--content-->not sure but the I think the only valid attribute of the Q tag is cite="..." where cite is the URL of the quoted text.<br />
You may also get an error if you are not using the correct DTD tag at the beginning of your xhtml/html document:<br />
<br />
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><br />
<br />
or whatever it should be for your document.<!--content-->In case anyone was interested, I figured out what the problem was. It appears that the lang attribute has, in fact, been removed from XHTML 1.1 (where it was in XHTML 1.0). It has been replaced by the xml:lang attribute. That information can be found in an [appendix (<!-- m --><a class="postlink" href="http://www.w3.org/TR/xhtml11/changes.html">http://www.w3.org/TR/xhtml11/changes.html</a><!-- m -->)] that I had not seen before.<!--content-->
 
Back
Top