[axiom] [axis2] getChildrenWithName() erroneous behavior
Glen Daniels <[email protected]>
| Newsgroups | gmane.text.xml.axis.devel,gmane.text.xml.commons.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi all:
Currently OMElement.getChildrenWithName(QName) uses the
OMChildrenQNameIterator to walk the list of children and return matches.
Here's the problem - if there is no namespace (or no localName...
luckily that part isn't possible), the iterator will happily match ANY
element with a matching localName. So for instance when we do this:
config_element.getChildrenWithName(new QName("transportSender"))
We'll get both <axisCfg:transportSender> and
<extension:transportSender>. This is bad. The above API call SHOULD
only match <transportSender> in no namespace.
XML is namespace-aware, and our code should be too. I'm going to change
getChildrenWithName() to match using QName.equals().
If people really want a localname-only match, we can add something like
OMElement.getChildrenWithLocalName(String), but it should be an
explicitly different API.
Thoughts?
--Glen