[jdom-interest] Re: jdom-interest Digest, Vol 56, Issue 13

Bradley S. Huffman bshuffman at gmail.com
Thu Jul 30 08:23:00 PDT 2009

On Thu, Jul 30, 2009 at 8:17 AM, S. Seide<ml-jdom at seide.st> wrote:
>> But http://xml.org/sax/features/namespace-prefixes is set to true in
>> SAXBuilder (along with http://xml.org/sax/features/namespaces), so my
>> understanding is getQName() should never be "".  If its a unprefixed
>> name, then getQName() should be returning the same as getLocalName().
>> In this case "version".
>> I can't remember, can you turn either of those SAX features off in SAXBuilder?
> turning them off givs the following results (application specific part
> of stack removed for better readability):

Oops sorry, what I meant was I'm confused why getQName is returning an
empty string.

If you're turning either SAX feature off that may explain why getQName
is returning an empty string.  The SAXBuilder.setProperty javadocs are
vague, but those two features are the ones that are currently required
to be set to true, and are done so by default in SAXBuilder.  Setting
either of them to false may or may not cause an exception.  It would
depend on the parser.

However, if you are not setting any SAX features and using the
defaults, then getQName should never be the empty string.  If it is
that suggests a bug in the parser.

More information about the jdom-interest mailing list