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).
Accepting bug and setting milestone to M15
Status: ASSIGNED → RESOLVED
Last Resolved: 20 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.
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?
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>
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.