"Bad character" - is it an IDEA bug?

When I type "<!----


>" as a XML comment, IDEA shows an error "Bad character" (please see the screenshot).

Is it an IDEA's bug or is it not acceptable in XML?



Attachment(s):
BadChar.png
6 comments

It is xml syntax.

Quote from the http://www.w3.org/TR/2006/REC-xml-20060816/#sec-comments:
For compatibility, the string "--" (double-hyphen) MUST NOT occur within comments.

0

But now it's really a bug.

Quote from http://www.w3.org/TR/2006/REC-xml-20060816/#sec-comments

']]>


"<!a->" has "a-" between "<!" and ">"
<!-a-> has "-a-" between "<!" and ">"

2 above examples should be correct following XML spec but IDEA still show "Bad character".

0

No, you're wrong. If you look closely at the specification is is:
- a sequence of
- either a character but not '-'
- or a '-' followed by
- a character but not '-'
There's no possibility to have a trailing '-'.

t800t8 wrote:

But now it's really a bug.

Quote from http://www.w3.org/TR/2006/REC-xml-20060816/#sec-comments

']]>


"<!a->" has "a-" between "<!" and ">"
<!-a-> has "-a-" between "<!" and ">"

2 above examples should be correct following XML spec.

0

Ah, now I see. Thanks Martin. I'm not familiar with the syntax they used.

0

Please sign in to leave a comment.