Re: Parsing of "<pre><samp> black && white </samp></pre>"

"JK" == Jose Kahan <jose.kahan@w3.org> writes:

  JK> Hello,

  JK> On Tue, Apr 24, 2001 at 05:32:53PM -0400, Vladimir G Ivanovic wrote:
  >> Amaya 4.3 (Linux) does not accept this:
  >> 
  >> 1	<html xmlns="http://www.w3.org/1999/xhtml">
  >> 2	<body>
  >> 3	<pre><samp>
  >> 4	black && white

  JK> The problem is that you should code the & as &amp;, otherwise it's being
  JK> interpreted as an entity name. The XML parser is much stricter than the
  JK> HTML one.

The definition of SAMP is "Designates sample output from program,
scripts, etc." (http://www.w3.org/TR/html401/struct/text.html). Program
code frequently contains `&' characters.

The definition in the book "XHTML 1.0" by Ian S. Graham, says "Samp
marks a block of text as a sequence of literal or sample characters..." 
(p. 66).

Both of these definitions imply to me that unescaped, literal `&'
characters are NOT to be interpreted, but rather output without change,
i.e. literally.

BTW, Netscape 4.76 (Linux), Opera 5.0b7 and Mozilla 0.8b1 all render my
test case as 

  black && white

although HTML Tidy does issue a warning and changes the `&' into
"&amp;".

The following

    <html xmlns="http://www.w3.org/1999/xhtml">
    <body>
    <script type="text/html">
    <![CDATA[
    black && white
    ]]>
    </script>
    </body>
    </html>

displays nothing in any browser (Netscape, Opera, Mozilla, Amaya), but
passes both HTML Tidy and the HTML Validator.

  JK> This is exactly what the parsing error reports, but not in such a
  JK> clear way:
  >> 
  >> *** Errors/warnings in /tilde/ivanovic/tmp/test.html temp file: /tilde/ivanovic/.amaya/1/test.html  line 4, char 7: not well-formed

  >> Q2: If it is a bug, how do I report it, both for Amaya and for the W3C
  >> HTML Validator.

  JK> I think it's a validator bug.

I'm not so sure. I don't know if the browser folks decided not to
implement the standard, didn't implement it correctly, or if your
interpretation of the HTML standard is wrong. My inclination is to think
it's bug in Amaya and HTML Tidy.

--- Vladimir

Vladimir G. Ivanovic                                     work: 650.812.4485 
Consultant, Xerox PARC                                   cell: 650.678.8014

Received on Thursday, 26 April 2001 04:08:52 UTC