"Cees Wesseling" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > it seems that xmlproc, the default Validating parser, in my setup does > not call back to setDocumentLocator. Is there anyway to get a locator > in my handler?
It's a known bug with a simple patch -- I don't know why it wasn't fixed in PyXML 0.8.4. http://sourceforge.net/tracker/?func=detail&aid=835638&group_id=6473&atid=106473 I had the same problem a while ago; I ended up doing a monkeypatch to xml.sax.drivers2.drv_xmlproc to add the missing call: import xml.sax.drivers2.drv_xmlproc # Override the set_locator method. def set_locator(self, locator): # Existing code. self._locator = locator # ...but also call the ContentHandler. # drv_xmlproc already implements the Locator interface. self._cont_handler.setDocumentLocator(self) setattr(xml.sax.drivers2.drv_xmlproc.XmlprocDriver, "set_locator", set_locator) HTH, James Kew http://jameskew.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list