Comments starting with dashes are not handled properly

CLOSED INVALID

Status

()

P3
normal
CLOSED INVALID
19 years ago
19 years ago

People

(Reporter: rbs, Assigned: nisheeth_mozilla)

Tracking

Trunk
x86
Windows 95
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

19 years ago
1/ Given the simplified test case document:

<?xml version="1.0"?>
<!--
  -- comment
  -->
<para>
</para>

The parser reports:

 XML Parsing Error: not well-formed Line Number 3, Column 4:
  -- comment
 ----^

2/ Given the modified test case document:
<?xml version="1.0"?>
<!--
  ** comment
  -->
<para>
</para>

The parser reports _no_ error. In other words, comment
lines starting with dashes are confusing to the parser.

3/ Given an empty document
<?xml version="1.0"?>
<!--
  ** comment
  -->

The parser reports an error: No element found.
(I am not sure if empty documents are not allowed in XML, and if therefore
the parser is in compliance with the XML REC which is pretty strict).
(Assignee)

Updated

19 years ago
Status: NEW → ASSIGNED
Target Milestone: M15
(Assignee)

Comment 1

19 years ago
Accepting bug and setting milestone to M15
Status: ASSIGNED → RESOLVED
Last Resolved: 19 years ago
Resolution: --- → INVALID
Hmm, no bug here. The string "--" is not allowed in an XML comment, so the
parser is 100% correct in saying that the first document is "not well formed".
See XML spec, section 2.5.
Marking INVALID.
(Reporter)

Comment 3

19 years ago
Right. Verified Sec 2.5 of the XML REC and saw the following
excerpt "For compatibility, the string "--" (double-hyphen)  must
not occur within comments."

What about point 3/. Are empty documents allowed or not allow in XML?
(Assignee)

Comment 4

19 years ago
All XML documents have to be well formed.  So, I think the following would be
the equivalent of an "empty" XML document:

<?xml version="1.0" ?>
<!DOCTYPE foo>
<foo></foo>
(Reporter)

Updated

19 years ago
Status: RESOLVED → CLOSED
(Reporter)

Comment 5

19 years ago
Verified. In Sec 2-2.1 of the XML REC, it is indeed mentioned that
all XML document must contain at least one element (which may possibly
be an empty <element/>) in order to be considered well-formed.

Making bug as closed.
You need to log in before you can comment on or make changes to this bug.