Re: On ampersands.

"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 UTC