Chris Maden <crism@oreilly.com> writes:
>
> [Rob Cameron]
> > Although the XML specification makes clear that "--" is not allowed
> > in comments, there is another case that is less clear. Can the body
> > of a comment end in a single hyphen, that is, is a comment like
> > "<--A+, A or A--->" legal? There is no explicit mention of this in
> > the text of the specification, but a careful read of the grammar
> > does not allow it.
>
> Correct. The production reflects the SGML reality that -- ends a
> comment. In SGML terms:
>
> '<!' starts the comment declaration in your example.
> '--' starts the comment.
> 'A+, A or A' is the content of the comment.
> '--' ends the comment.
> '-' is an error.
> '>' could be considered to end the comment declaration, but
> we're now in error-recovery mode, and outside the scope
> of the specification.
>
> <!--A+, A or A- --> is a legal comment.
>