INS & DEL elements

I wrote about this to the www-html@w3.org mailing list, but perhaps it was
missed as it doesn't seem to have changed in the latest version of the
specification.  Or perhaps you're trying to decide on a different way of
marking up changes in text, as there was some discussion about this on the
list recently, and so haven't paid attention to the problems in the INS/DEL
definitions from the previous draft.  Anyway:

I may be reading the DTDs [1][2] wrongly, but they look to be saying that
INS & DEL can only contain %inline elements and can only come directly
within the BODY element.  This might be intended, but if it is, then the
text within the specification should be changed.

The element definition for INS & DEL is given as:

   <!ELEMENT (INS|DEL) - - (%inline;)* -- inserted text, deleted text -->

However, the specification [3] reads:

   These two elements are unusual for HTML in that they are neither
   block-level nor inline elements. They may contain one or more words
   within a paragraph or contain one or more block-level elements such
   as paragraphs, lists and tables.

If INS & DEL *can* contain block-level elements, then its content model
should include %blocklevel; as well as %inline;, as the OBJECT element
definition gives, i.e.

   <!ELEMENT (INS|DEL) - - (%blocklevel; | %inline;)* -- inserted text,
deleted text -->

If INS & DEL *can't* contain block-level elements, then it shouldn't say
that they can within the specification.

I had another kind of panic over where INS & DEL elements were allowed.
INS & DEL are classified as neither %blocklevel; nor %inline; elements.
Indeed, as the comment above their definition says:

   <!-- INS/DEL are handled by inclusion on BODY -->

The definition of the BODY element gives:

   <!ELEMENT BODY O O  (%block;)+ +(INS|DEL) -- document body -->

Since INS & DEL are not allowed within other elements, this surely means
that INS & DEL are only allowed *directly within* the BODY element i.e.
that:

   <BODY>
   <P>
   This is a demonstration of the use of the DEL tag within a paragraph
   contained by a <DEL>PRE element</DEL><INS>P element</INS>.
   </BODY>

would have to be interpreted by the browser as:

   <BODY>
   <P>
   This is a demonstration of the use of the DEL tag within a paragraph
   contained by a
   </P>
   <DEL>PRE element</DEL>
   <INS>P element</INS>
   </BODY>

Indeed, the following markup would be illegal:

   <BODY>
   <DIV class="subsection">
   <P>
   This is a demonstration of the use of the DEL tag within a paragraph
   contained by a <DEL>PRE element</DEL><INS>P element</INS>.
   </DIV>
   </BODY>

as the DIV element cannot contain INS or DEL elements.

Please let me know if I'm reading the DTDs wrongly as I'd like to learn how
to read them properly if that's the case.

Cheers,

Jeni

[1] http://www.w3.org/TR/WD-html40/sgml/HTML4-strict.dtd
[2] http://www.w3.org/TR/WD-html40/sgml/HTML4-loose.dtd
[3] http://www.w3.org/TR/WD-html40/struct/text.html#h-10.4


Jeni Tennison
Department of Psychology, University of Nottingham
University Park, Nottingham NG7 2RD, UK
tel: +44 (0) 115 951 5151 x8352
fax: +44 (0) 115 951 5361
url: http://www.psychology.nottingham.ac.uk/staff/Jenifer.Tennison/

Received on Thursday, 18 September 1997 04:57:29 UTC