

The <blockcode> and <l> elements

From: Lachlan Hunt <lhunt07@postoffice.csu.edu.au>
Date: Wed, 05 Nov 2003 00:50:00 +1100
Message-ID: <3FA7AE88.2040508@postoffice.csu.edu.au>
To: www-html@w3.org

  Should the <blockcode> element's content model be changed from:

<!ELEMENT blockcode (PCDATA | Inline | Heading | Block | List)*>

to something more like:

1. <!ELEMENT blockcode (l)*> OR
2. <!ELEMENT blockcode (PCDATA | l)*>

These could be written, respectively,as:

<l>public static void main(String[] args) {</l>
<l>    System.out.println("Hello World"); <span class="comment">// 
Output Hello World!</span></l>


public static void main(String[] args) {
<l>    System.out.println("Hello World");</l>

  For version 2, IMHO, it is not logical for some lines of code to have 
the <l> and other's to not.  Version 1, IMO, represents more 
semantically what program code is -- many lines, making up a code block.

  Also, with the existing content model, it is possible to include 
virtually any element (all?) like <h>, <p>, <ul>, etc...  Real program 
code cannot contain headings, paragraphs or lists, only lines of code, 
therefore, the current content model is semantically incorrect.

NOTE: I think the example of using the <l> element
      in XHTML Inline Text Module[1],
      should be changed from:

      <p class="program">

      to something similar to the <blockcode>
      example (1) above instead.

      The current example is an example of an
      author defining their own semantics with
      the class attribute, rather than using
      existing elements.

The <l> Element

  What if an author wrote the following?
  (I'm quite sure this example would be valid, correct me if I'm wrong)

<p>This is a paragraph with a <l></l> line break in the middle.</p>

  or used the compact version: <l/>?

  This (poor) use, obviously, has no more structure than the <br/> 
element that it has been designed to replace, and thus could be used to 
'abuse' the language.  I cannot think of any solution to this problem, 
unless there was some way to specify in the DTD or Schema that this 
element *cannot* be empty.  I only bring this up to make aware a 
possible way that the XHTML2.0 language could be abused by authors.

Received on Tuesday, 4 November 2003 08:49:58 UTC
