The <blockcode> and <l> elements

Hi,
  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:

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

OR:

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

  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">
      <l>...</l>
      </p>

      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.

[1] 
http://www.w3.org/TR/2003/WD-xhtml2-20030506/mod-inline-text.html#sec_9.7.

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