Reported by Michael Kay 2001-05-16:
There is an undocumented assumption in
org.xml.sax.helpers.NamespaceSupport
that
in a new namespace context, any declarePrefix() calls
will be made before
any processName() call. Otherwise a name may be
retrieved from the cache and
assigned the wrong namespace URI. This only happens if
a qname (of an
element or attribute) is used on one element, and the
same qname is used on
an ancestor element, but they bind to different
namespace URIs.
I've fixed the problem in the AElfred SAXDriver by
processing all the
namespace declarations before processing the "real"
attributes.
David: the SAX2 ParserAdapter (in the latest bug-fixed
version) calls
processName() for attributes as soon as they are
encountered, but if a
namespace declaration is then found, the processName()
is done again and the
original incorrect value is discarded. However, I don't
think this solves
the problem, because on the second call, the
(incorrect) value will be
retrieved from the cache held in NamespaceSupport. So I
think the same bug
is present in the SAX2 ParserAdapter (but I haven't
checked by testing it).
I haven't tried to change NamespaceSupport.
Logged In: YES
user_id=44117
Yep, two bugs: (a) doc for NamespaceSupport,
and (b) ParserAdapter needs to use two passes.
I'm not sure yet about the caching issue; that
might be due to not using separate passes.
Logged In: YES
user_id=44117
Given more info from Mike, I'm treating this
bug report as (b) below, and 441056 as (a).
Fixes to both are in the works.