This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 798 - Error instead of warning for ampersand as data in XHTML
Summary: Error instead of warning for ampersand as data in XHTML
Status: RESOLVED FIXED
Alias: None
Product: Validator
Classification: Unclassified
Component: Parser (show other bugs)
Version: HEAD
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Terje Bless
QA Contact: qa-dev tracking
URL: http://www1.ndr.de/ndr/ndr_pages_idx/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-06-15 09:48 UTC by Joern Hofer
Modified: 2006-11-08 01:14 UTC (History)
1 user (show)

See Also:


Attachments

Description Joern Hofer 2004-06-15 09:48:30 UTC
Hi,
i got a page with a link and title-Tag like this:
<li><a href="/ndr/ndr_pages_idx/0,2571,SPM908,00.html" title="KONZERTE &
EVENTS"><img src="/container/ndr_style_images_gen_default/0,2718,65996,00.jpg"
height="19" alt="KONZERTE & EVENTS" /></a></li>
and the Validtor still says, it is valid XHTML 1.0 Strict, even the amersand is
used as Data.

If i got a page with another Error, the Validtor correctly says: Ampersand used
as Data.

If i don't have any Error, except the Ampersand, he says, it ist Valid.

Validating with the CSE HTML Validator Pro and the http://www.validome.org/:
Both got an error with the Amerpsand (and they are right, i think).

I think this must be a Bug with the Validator.

The URL above is a dynamic-page, so it could be, that in 1 hour there isn't any
ampersand, so i paste in here some source around of the error:

<div id="leftNav" class="submenu"><ul>
<li><a href="/ndr/ndr_pages_idx/0,2571,SPM902,00.html" title="KINO-TIPPS"><img
src="/container/ndr_style_images_gen_default/0,2718,52182,00.jpg" height="19"
alt="KINO-TIPPS" /></a></li>
<li><a href="/ndr/ndr_pages_idx/0,2571,SPM1476,00.html"
title="FILMFESTIVALS"><img
src="/container/ndr_style_images_gen_default/0,2718,105874,00.jpg" height="19"
alt="FILMFESTIVALS" /></a></li>
<li><a href="/ndr/ndr_pages_idx/0,2571,SPM904,00.html" title="FILME IM
FERNSEHEN"><img
src="/container/ndr_style_images_gen_default/0,2718,52190,00.jpg" height="19"
alt="FILME IM FERNSEHEN" /></a></li>
<li><a href="/ndr/ndr_pages_idx/0,2571,SPM908,00.html" title="KONZERTE &
EVENTS"><img src="/container/ndr_style_images_gen_default/0,2718,65996,00.jpg"
height="19" alt="KONZERTE & EVENTS" /></a></li>
<li><a href="/ndr/ndr_pages_idx/0,2571,SPM910,00.html" title="CD-TIPPS"><img
src="/container/ndr_style_images_gen_default/0,2718,66000,00.jpg" height="19"
alt="CD-TIPPS" /></a></li>
<li><a href="/ndr/ndr_pages_idx/0,2571,SPM912,00.html" title="QUIZ &
SPIELE"><img src="/container/ndr_style_images_gen_default/0,2718,66004,00.jpg"
height="19" alt="QUIZ & SPIELE" /></a></li>
<li><a href="/ndr/ndr_pages_idx/0,2571,SPM1102,00.html" title="LEUTE"><img
src="/container/ndr_style_images_gen_default/0,2718,86754,00.jpg" height="19"
alt="LEUTE" /></a></li>
</ul></div>

Am i right or am i stupid? ;-)
Comment 1 Ville Skyttä 2004-06-15 13:11:30 UTC
I am pretty sure that you are right, and that this is why there is the "Note:
The Validator XML support has some limitations." link as the very first thing in
the XHTML validation results page... See http://openjade.sourceforge.net/doc/xml.htm
Comment 2 Bj 2004-06-17 13:35:51 UTC
You would get a warning, see

http://www.websitedev.de/markup/validator/tests/ampersand-as-data.html,validate

Even with Validome.org all you get is a warning.
Comment 3 Terje Bless 2005-02-05 04:28:47 UTC
This was a symptom of some warnings not getting displayed when the page was
otherwise valid; the warning about the bare amperstand was always there, it
was just being supressed.

This issue has been resolved in current development code.
Comment 4 Olivier Thereaux 2006-10-31 06:39:46 UTC
checking a bunch of bugs today, I noticed that S:P:O seems to not give this "ampersand as data" warning, whereas openSP does. 

compare:
http://qa-dev.w3.org/wmvs/0.7.3/check?uri=http%3A%2F%2Fwww1.ndr.de%2Fndr%2Fndr_pages_idx%2F0%2C2571%2CSPM880%2C00.html
and
http://qa-dev.w3.org/wmvs/HEAD/check?uri=http%3A%2F%2Fwww1.ndr.de%2Fndr%2Fndr_pages_idx%2F0%2C2571%2CSPM880%2C00.html

Bjoern, is that a bug in S:P:O? Should I be sending it your way?
Comment 5 Bj 2006-10-31 07:44:47 UTC
I think I fixed this bug in SGML::Parser::OpenSP CVS in so far as it is the cause of this issue. A workaround in check would be to push() 'xml' twice into the options array, only the last item in ->warnings(...) will be ignored, as far as I could tell.
Comment 6 Olivier Thereaux 2006-11-07 06:22:10 UTC
Bjoern,

(In reply to comment #5)
> I think I fixed this bug in SGML::Parser::OpenSP CVS in so far as it is the
> cause of this issue.

Have you tested it successfully? I updated my version (on laptop computer) of s.p.o to the version in CVS late last week, and saw no change in behavior, at least from the point of view of 
check?uri=http%3A%2F%2Fwww.websitedev.de%2Fmarkup%2Fvalidator%2Ftests%2Fampersand-as-data.html


> A workaround in check would be to push() 'xml' twice into
> the options array, only the last item in ->warnings(...) will be ignored, as
> far as I could tell.

I did that in check, and unless I misunderstood your suggestion, it is not working, either.

http://qa-dev.w3.org/wmvs/HEAD/check?uri=http%3A%2F%2Fwww.websitedev.de%2Fmarkup%2Fvalidator%2Ftests%2Fampersand-as-data.html

Comment 7 Bj 2006-11-07 11:20:42 UTC
Yes, I tested it and I've now also added a new test case t/22mwarnings.t to CVS that tests for this particular case twice. The test succeeds on my platform. If the Validator does not handle it properly, it might be that the branch where you push the option is never executed due to some XHTML detection issues, as we discussed on IRC. If t/22mwarnings.t succeeds on your platform, I don't see how this can be a problem in SGML::Parser::OpenSP.
Comment 8 Bj 2006-11-07 11:40:33 UTC
I think the current code just lacks

  $opensp->warnings(@spopt);
Comment 9 Olivier Thereaux 2006-11-08 01:14:37 UTC
(In reply to comment #8)
> I think the current code just lacks
> 
>   $opensp->warnings(@spopt);

Confirmed, and closed. Pushing to CVS in a moment.
Thanks Bjoern.