W3C home > Mailing lists > Public > www-validator@w3.org > February 2004

Re: Unescaped XML Ampersands Incorrectly Validated

From: Nick Kew <nick@webthing.com>
Date: Mon, 1 Mar 2004 04:18:51 +0000 (GMT)
To: "Sean B. Palmer" <sean@mysterylights.com>
Cc: www-validator@w3.org
Message-ID: <Pine.LNX.4.53.0403010405500.19315@hugin.webthing.com>

> This is not well-formed, but the validator passes it:
> http://infomesh.net/200X/valid-amp-bug.html

With a warning that should be an error.

> The issue is that there is an unescaped ampersand "&" in the source
> which is not being detected.

It is detected - it's just classified at the wrong level.
Validation with Xerces gets it right.

> Further IRC discussion:
> <xover> Uhm. What's the problem?
> <xover> The unescaped amperstand?
> <xover> That's an artifical constraint imposed only by the prose of
>    the XML REC and inexpressible in a DTD or SGML AFAICT.
> <xover> And since OpenSP doesn't allow us to treat it as an error, we
>    do the best we can by emitting a warning instead.

But OpenSP *does* treat it as a warning!

> <sbp> nontheless, it's a constraint
> <deltab> um, what is?
> <sbp> ampersands must be escaped as &amp; in XML PCDATA
> <deltab> yes, as they must anywhere
> <xover> "anywhere" (almost) in XML. Not in SGML.
> <deltab> where not in SGML?
> <xover> SGML allows the & to appear bare anywhere it is unambigious.
> - Swhack, 2004-02-29 21:00

Yes, and in HTML, OpenSP won't complain.  Not even in fussy mode!

BTW, thats a nast'y cas'e o'f greengrocers apostroph'e.

> Please let me know whether this is appropriate enough a bug to enter
> into the database at <http://www.w3.org/Bugs/Public/>. (It would also
> be appreciated if the validator.w3.org feedback page were more
> bug-report oriented!)

I'd say yes - but it looks to me like an OpenSP bug.

Nick Kew
Received on Sunday, 29 February 2004 23:18:53 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:58:39 UTC