[jdom-interest] Possible bug in SAXHandler when "namespaces" feature is off

Jason Hunter jhunter at servlets.com
Mon Jan 19 11:05:44 PST 2004


> Let me reiterated my point, which is that even though all modern SAX parsers
> SUPPORT namespaces, that support can be DISABLED for whatever reason, and
> JDOM should be smart enough to either deal with it or explicitly report that
> it cannot deal with it.  Instead, it throws an obscure exception in the
> middle of the construction of the tree.

 From the SAXBuilder.setFeature() Javadocs:

   * This sets a feature on the SAX parser. See the SAX documentation for
   * </p>
   * <p>
   * NOTE: SAXBuilder requires that some particular features of the SAX 
parser be
   * set up in certain ways for it to work properly. The list of such 
features
   * may change in the future. Therefore, the use of this method may cause
   * parsing to break, and even if it doesn't break anything today it might
   * break parsing in a future JDOM version, because what JDOM parsers 
require
   * may change over time. Use with caution.
   * </p>

As this explains, you use setFeature() at your own risk.  It's a power 
tool back door with warning signs on the handle.  If you're turning off 
namespace support, that's going to break things as the warning says.  I 
think we once tried to protect the underlying parser from bad feature 
changes, but it didn't work very reliably.  Too many custom parser tweak 
options I think it was.

> By the way, I have another question: is there a bug reporting database for
> JDOM? I could not find a link on the Jdom.org website.

You can report bugs to this mailing list.  The TODO file tracks the main 
outstanding issues.

-jh-




More information about the jdom-interest mailing list