Closed
Bug 8073
Opened 26 years ago
Closed 26 years ago
Mozilla allows missing end tags in XML, not well-formed...
Categories
(Core :: XML, defect, P3)
Core
XML
Tracking
()
VERIFIED
FIXED
M17
People
(Reporter: jst, Assigned: nisheeth_mozilla)
Details
The XML file
----
<a><b><c>foo</c>
----
doesn't produce an error message even tough the 'a' and 'b' tags are never
closed. This is rather critical since a user could be served only half a file of
the network without the user ever knowing about this...
| Assignee | ||
Updated•26 years ago
|
Status: NEW → ASSIGNED
| Assignee | ||
Comment 1•26 years ago
|
||
Accepting bug. Setting milestone to M9...
| Assignee | ||
Updated•26 years ago
|
Target Milestone: M9
| Assignee | ||
Comment 2•26 years ago
|
||
Ccing James Clark, owner of expat.
James, this error was happening because XML_Parse() was not being called with
isFinal set to true after the entire XML document had been fed to expat. I
fixed that and got back an error from expat for the test case pasted in this bug
report. However, when I tried to query expat for more information about the
error, the error code, line number and column number queries come back with
good data, but XML_GetCurrentByteIndex() returns -1. Any thoughts?
| Assignee | ||
Updated•26 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 26 years ago
Resolution: --- → FIXED
| Assignee | ||
Comment 3•26 years ago
|
||
James, please don't spend any time on this. I found the problem. We only know
that a given buffer is the last buffer after the buffer has been sent to expat.
So, we make a redundant call to XML_Parse() with an empty buffer and isFinal set
to TRUE. If this last, redundant call returns an error, then, the subsequent
XML_GetCurrentByteIndex() call returns -1 because there is no buffer to provide
a byte index into.
I now cache the last line of the previous buffer. If the above case occurs, I
use the cached last line to diplay source line information for the error.
Marking bug fixed.
Pasting description of this bug fix from the n.p.m.layout.checkins newsgroup:
----
Expat can determine that there is an error in the above XML file only if it is
told that the above XML snippet is the last
piece of data in the XML file. Till now, this information was not provided by
the parser to the expat tokenizer. Hence,
the bug.
Now, nsITokenizer contains new WillTokenize() and DidTokenize() methods. The
parser calls these methods before and
after it sends a chunk of data for tokenization. Both these methods accept an
aIsFinalChunk parameter which is set to
true when the parser sends the last chunk of data.
Nisheeth
--
| Assignee | ||
Updated•26 years ago
|
Status: VERIFIED → REOPENED
Target Milestone: M9 → M11
| Assignee | ||
Updated•26 years ago
|
Status: REOPENED → ASSIGNED
| Assignee | ||
Comment 5•26 years ago
|
||
Re-opening bug and setting target milestone to M11. I'll post James' email next
which details why there might still be a bug.
| Assignee | ||
Comment 6•26 years ago
|
||
Accept bug
| Assignee | ||
Comment 7•26 years ago
|
||
Comments from James Clark:
---
I don't understand this. XML_GetCurrentByteIndex() gives the index into
the entire document, not into the current buffer. If
XML_GetCurrentLineNumber() works then XML_GetCurrentByteIndex() should
work as well. I'm puzzled becauuse can't see how
XML_GetCurrentByteIndex() could fail to work in a case where
XML_GetCurrentLineNumber() does work. I'm still worried that there may
be a bug lurking here.
---
| Assignee | ||
Updated•26 years ago
|
Target Milestone: M11 → M14
| Assignee | ||
Comment 9•26 years ago
|
||
Not a beta stopper. Moving to M14...
| Assignee | ||
Comment 10•26 years ago
|
||
Bulk moving all M14 non-beta stopper bugs to M17...
| Assignee | ||
Comment 11•26 years ago
|
||
This bug is fixed. I'll track the problem outlined in James Clark's comment
separately.
Status: ASSIGNED → RESOLVED
Closed: 26 years ago → 26 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•