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

On Wed, Sep 5, 2012 at 4:22 AM, John Cowan <cowan@mercury.ccil.org> wrote:

> Liam R E Quin scripsit:
>
> > XML says, "For compatibility, the string " -- " (double-hyphen) must not
> > occur within comments."
> >
> > 11a. Should we allow <!-- -- --> as a 琪ML 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.
>

"--" in comments are also disallowed by the XML 1.0  grammar

Comment   ::=   '<!--' ((Char - '-') | ('-' (Char - '-')))* '-->'

So it's a well-formedness error.


> However, this raises the question of whether we should impose only
> the looser XML specification of a comment or the tighter HTML5
> specification.


This goes back to the issue of what we are trying to achieve as regards
HTML5 friendliness, which also affects the issue of whether to allow a bare
DOCTYPE.

James

Received on Thursday, 6 September 2012 01:50:16 UTC