W3C home > Mailing lists > Public > www-validator@w3.org > November 2003

Re: Ampersands (was Re: [VE][338] New Error Message Suggestion)

From: Jukka K. Korpela <jkorpela@cs.tut.fi>
Date: Mon, 10 Nov 2003 14:05:22 +0200 (EET)
To: David Dorward <david@dorward.me.uk>
Cc: "Ullrich, Andreas" <Andreas.Ullrich@DREGIS.com>, "'www-validator@w3.org'" <www-validator@w3.org>
Message-ID: <Pine.GSO.4.58.0311101354260.17137@korppi.cs.tut.fi>

On Mon, 10 Nov 2003, David Dorward wrote:

> > Line 9, column 27: cannot generate system identifier for general
> > entity "v"
> > <a href="test.php?f=region&v=1">test</a>
> > what is the problem??
> &v is not an entity.

Actually in SGML (and hence in pre-XHTML HTML) it _is_ an entity
reference, just an undefined one, and that exactly is the problem then.
The error message quoted above says this, though admittedly in a rather
difficult language.

In XML, it is not an entity reference, since by XML rules, the semicolon
is obligatory. The construct is incorrect in XML by the rule that says:
"The ampersand character (&) and the left angle bracket (<) may appear in
their literal form only when used as markup delimiters, or within a
comment, a processing instruction, or a CDATA section. If they are needed
elsewhere, they must be escaped using either numeric character references
or the strings "&amp;" and "&lt;" respectively."

A validator's error message should thus depend on whether it acts as an
SGML validator or as an XML validator.

Jukka "Yucca" Korpela, http://www.cs.tut.fi/~jkorpela/
Received on Monday, 10 November 2003 07:05:26 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 1 March 2016 14:17:39 UTC