W3C home > Mailing lists > Public > www-validator@w3.org > July 2000

Re: On ampersands.

From: Masayasu Ishikawa <mimasa@w3.org>
Date: Fri, 07 Jul 2000 02:57:56 +0900
To: www-validator@w3.org
Message-Id: <20000707025756P.mimasa@w3.mag.keio.ac.jp>
"Shane P. McCarron" <shane@aptest.com> wrote:

> "Shane P. McCarron" wrote:
> > 
> > Gerald Oskoboiny wrote:
> > > There are some cases where the ampersands don't need to be
> > > escaped, like: <p>foo & bar</p>, or <a href="foo&_bar">
> > >
> > 
> > I don't think I agree.  In SGML, an ampersand always introduces an
> > entity reference.  If you want to actually use an ampersand, you are
> > required to use &amp;. I don't see any way around this requirement.
> 
> Okay...  The XML specification is pretty clear on this, and is available
> on-line at http://www.w3.org/TR/REC-xml

Well, you're right in terms of XML, but you're wrong in terms of SGML.
This is where SGML and XML differ.

"Comparison of SGML and XML" [SGML-XML] says:

   XML imposes the following restrictions not in SGML:

     * Entity references
          + Entity references must be closed with a REFC delimiter
		(snip)
     * Character references
          + Character references must be closed with a REFC delimiter
		(snip)
     * Other
		(snip)
          + When < and & occur as data, they must be entered as &lt; and
            &amp;

[SGML-XML] http://www.w3.org/TR/NOTE-sgml-xml

Regards,
-- 
Masayasu Ishikawa / mimasa@w3.org
W3C - World Wide Web Consortium
Received on Thursday, 6 July 2000 13:58:00 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 25 April 2012 12:13:54 GMT