Re: simplifying comments in SGML '97
If you define comment as:
>  comment = como, SGML character*, comc
> [92a] simple comment declaration =
> mdo, com, SGML character*, com, mdc
you cannot say
> No markup is recognized in a comment, other than the com
> delimiter that terminates it.
You must change com to comc, or retain com in place of como and comc.
(I'm not clear that como and comc buy you enough to invent two more
delimiters, with their associated parsing contexts)
The following note does not make sense if you use como and comc to delimit
> 1. A com delimiter not followed by an mdc delimiter will be
> recognized in a comment (in a comment declaration or other
> declaration) but not in a simple comment declaration.
Then there is option B!
>B. Splitting the com delimiter.
>This proposal simply replaces the 8879 com delimiter with a pair of
>delimiters, como and comc (comment open and comment close). Documents
>using 8879:1986 syntax have como = comc = com; in the RCS that's
>como = comc = '--'. XML could allow -- within comments by setting
>como to '--*' and comc to '*--', to retain the general look and feel
>of current comments, and still allow '--' in the comment itself.
>Nested comments might also become possible, in SGML (and then in XML),
Why go to all this fuss: simply change com in XML to "*--" or, better still
"**", and then -- becomes legal!
>Production 91 of 8879 could remaing the same as it now is; 92 would
>change. We might have:
> 91 comment declaration = mdo, (comment, (s | comment)*)?, mdc
> 92 comment = como, SGML character*, comc
How does this approach restrict XML to a single comment?
>or (to allow nested comments)
> 92 comment = como, (SGML character | comment)*, comc
So now I can mix text with comments e.g.
<!*-- Here is a --comment-- with *-- and --* --embedded-- within it --*>
How very clever!
>Note: If this is what we propose to WG8,
it will be rejected!
>the XML spec should probably
>change *now* to use these delimiters, replacing production 21 with
>  Comment ::= '<!--*' [µ-]* ('-' [µ-]+)* '*-->'
>Advantages: this seems relatively simple and relatively compatible
>with the look and feel of 8879 as a whole. Disadvantages: it
>doesn't allow the SGML parser to enforce XML's rules.
And won't work as it fails to make -- legal, which seemed to be the whole
point of this useless exercise.!
Martin Bryan, The SGML Centre, Churchdown, Glos. GL3 2PU, UK
Phone/Fax: +44 1452 714029 WWW home page: http://www.u-net.com/~sgml/