Re: 11 - whether "--" and % are allowed in comments, is > allowed in a PI

Liam R E Quin scripsit:

> XML says, "For compatibility, the string " -- " (double-hyphen) must not
> occur within comments."
> 
> 11a. Should we allow <!-- -- --> as a µXML comment?
> 
> The XML spec does not say that compatibility constraints are not
> binding, so I believe the above not to be well-formed XML, and the
> answer should be that it is to be forbidden.

Indeed, it says MUST NOT, so it is an error, though not a fatal one.
I don't know of any XML processors that treat non-fatal errors
differently from fatal ones.

> 11b. Should we allow % inside a µXML comment? The spec says,
> "Parameter entity references must not be recognized within comments"
> which I interpret to be an instruction to the parser not to treat %
> specially inside comments. 

I agree that this is what the XML Rec means and that there's nothing
that MicroXML needs to say.

However, this raises the question of whether we should impose only
the looser XML specification of a comment or the tighter HTML5
specification.  I favor the latter, which requires that the body
of a comment (after the "<!--") cannot begin with "-" or "->").
Both James's draft and my draft provide for this:

comment ::= '<!--' (commentContentStart commentContentContinue*)? '-->'

commentContentStart ::= (char - ('-'|'>')) | ('-' (char - ('-'|'>')))

commentContentContinue ::= (char - '-') | ('-' (char - '-'))

-- 
John Cowan                              <cowan@ccil.org>
            http://www.ccil.org/~cowan
                .e'osai ko sarji la lojban.
                Please support Lojban!          http://www.lojban.org

Received on Tuesday, 4 September 2012 21:22:34 UTC