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)

defect

Tracking

()

VERIFIED FIXED

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...
Status: NEW → ASSIGNED
Accepting bug. Setting milestone to M9...
Target Milestone: M9
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?
Status: ASSIGNED → RESOLVED
Closed: 26 years ago
Resolution: --- → FIXED
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 --
Status: RESOLVED → VERIFIED
Marking this Verified Fixed based on nisheeth's comments.
Status: VERIFIED → REOPENED
Target Milestone: M9 → M11
Status: REOPENED → ASSIGNED
Re-opening bug and setting target milestone to M11. I'll post James' email next which details why there might still be a bug.
Accept bug
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. ---
Resolution: FIXED → ---
Clearing Fixed resolution due to reopen.
Target Milestone: M11 → M14
Not a beta stopper. Moving to M14...
Bulk moving all M14 non-beta stopper bugs to M17...
This bug is fixed. I'll track the problem outlined in James Clark's comment separately.
Status: ASSIGNED → RESOLVED
Closed: 26 years ago26 years ago
Resolution: --- → FIXED
Fixed in the July 6th builds.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.