HTML 4.01 no <ins> in <pre>?

   I'm not sure if I've found a mistake or just something that I don't
understand the reason for.  I am using XHTML 1.0 and referring to the
HTML 4.01 spec for guidance.  I get an error from the validator at W3C
but it sounds to me (from the spec, not the DTD) that I am correct.

   Here is what I am trying to represent in markup: I am updating an
errata list for a textbook that contains pseudocode.  Because the
formatting of the pseudocode is significant I'm using <pre> to
maintain the formatting and because I am showing insertions I'm using
<ins>.  But the validator says something is wrong

   A small but complete example is enclosed at the end of this e-mail.
Here is part of the example I'm having trouble with:

   <dd>
    The event part (above the line) should read:
    <pre class="code">
      rdt_rcv(rcv_pkt)<br />
      &amp;&amp; notcorrupt(rcvpkt)<br />
      <ins>getacknum(rcvpkt)&gt;=base</ins>
    </pre>
   </dd>

   The validator says:

>    Below are the results of checking this document for XML
>    well-formedness and validity.
>
>      Line 120, column 12: 
>
>                <ins>getacknum(rcvpkt)&gt;=base</ins>
>                    ^
>
>      Error: element "ins" not allowed here; possible cause is an
>      inline element containing a block-level element 


  When I remove the <ins> (and </ins>) then the document is reported
as valid.  But when they are present inside <pre> (and </pre>) the
document is reported as invalid.

  It seems strange to me that 

   <dd>
    The event part (above the line) should read:
    <blockquote>
     <p>
      <code>
       rdt_rcv(rcv_pkt)<br />
       &amp;&amp; notcorrupt(rcvpkt)<br />
       <ins>getacknum(rcvpkt)&gt;=base</ins>
      </code>
     </p>
    </blockquote>
   </dd>

is valid because I don't think of it as having the same semantics.
But it passes a validation check.

   Please tell me if there really is a problem with the DTD or
validator.  Otherwise I will appreciate it if you would explain to me
why <ins> is not allowed inside <pre> (or <blockquote>).

   Much obliged,
--
Jamie Blustein <jamie@cs.dal.ca>


 - - - 8< - - -  [enclosure begins] - - - 8< - - - 
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 <head>
  <title>
    Misprint Corrections for Kurose &amp; Ross
  </title>
 </head>
 <body>
 <p>[Blah blah blah]</p>
   <dl>
     <dt>Page 198, Figure 3.19, left-hand side</dt>
      <dd>
        The window should not be advanced for just any non-corrupted <abbr
        title="acknowledgment packet">ACK</abbr>.  The window should only
        advance if the <abbr>ACK</abbr> is for a packet that is in the
        current window, <abbr title="that is">i.e.</abbr> if
        <code>(acknum(rcvpkt) == base) || (acknum(rcvpkt) &gt;
        base)</code>.  If the <abbr>ACK</abbr> is for a packet with
        sequence number less than <code>base</code> then the packet should be
        ignored.
      </dd>
      <dd>
        The event part (above the line) should read:
        <pre class="code">
        rdt_rcv(rcv_pkt)<br />
        &amp;&amp; notcorrupt(rcvpkt)<br />
        <ins>getacknum(rcvpkt)&gt;=base</ins>
        </pre>
      </dd>
   </dl>
  <p>[Blah blah blah]</p>
 </body>
</html>
 - - - >8 - - - [enclosure ends] - - - >8 - - - 

Received on Tuesday, 9 July 2002 21:21:48 UTC