[jdom-interest] Sad failure...

Laurent Bihanic laurent.bihanic at atosorigin.com
Fri Aug 24 07:00:26 PDT 2001

The method name is setDocumentLocator, not setLocator. Be warned that if you 
are deriving from DefaultHandler (which defines this method as empty), the 
compiler will not warn you of any spelling mistake.

We use Locators with both Xerces and Crimson and they work OK.

Hope this helps,


Paul Libbrecht wrote:

> Hi,
> It seems my project to use the org.xml.sax.Locator objects that parsers 
> "are strongly encouraged to provide" to create a JDOM document with 
> source locators is plainly failing...
> Between the three parsers I have at hand (Saxon's AElfred, Xerces and 
> OpenXML), none have called my "setLocator" method !!
> Does anyone know if these provide them ? Or of any other such parsers ?
> I guess I'll set myself to use the jdom XMLOutputter to have my positions,
>  hoping that XMLOutputter will remain faithful in rendering the exact 
> source.
> Paul

More information about the jdom-interest mailing list