Open Bug 526588 Opened 15 years ago Updated 2 years ago

Add setDocumentLocator(nsISAXLocator locator) to nsISAXContentHandler

Categories

(Core :: XML, defect)

defect

Tracking

()

UNCONFIRMED

People

(Reporter: rcoacci, Unassigned)

References

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; pt-BR; rv:1.9.1.4) Gecko/20091016 Firefox/3.5.4 (.NET CLR 3.5.30729)
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.10 (.NET CLR 3.5.30729) XPCOMViewer/0.9a

As per ContentHandler interface in http://www.saxproject.org/apidoc/org/xml/sax/ContentHandler.html, there should be a setDocumentLocator method in the nsISAXContentHandler, and the implementation should pass the locator from the underlying driver to the ContentHandler (this is done for errors, see nsISAXErrorHandler). This will help get line/column numbers from XML/XHTML files.

Reproducible: Always

Steps to Reproduce:
1.Create an ContentHandler object as per the SAX "official" interface.
2. Add it to an SAXXMLReader obtained from Components.classes["@mozilla.org/saxparser/xmlreader;1"].createInstance(Components.interfaces.nsISAXXMLReader)  
3. Parse some XML

Actual Results:  
Notice that the setDocumentLocator method isn't called.

Expected Results:  
setDocumentLocator should have been called and passed a valid Locator.
Blocks: 812302
I could add it fairly easily, but keeping it up to date with line number & column number would be much, much harder.
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.