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

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."
  http://www.w3.org/TR/REC-xml#syntax

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