Re: [axiom] [axis2] getChildrenWithName() erroneous behavior

Sanjiva Weerawarana <[email protected]>
Newsgroups gmane.text.xml.axis.devel,gmane.text.xml.commons.devel
Organization WSO2 Inc.
Message-ID <[email protected]>
+1.

Glen Daniels wrote:
> 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
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
> 
> 

-- 
Sanjiva Weerawarana, Ph.D.
Founder & Director; Lanka Software Foundation; http://www.opensource.lk/
Founder, Chairman & CEO; WSO2, Inc.; http://www.wso2.com/
Director; Open Source Initiative; http://www.opensource.org/
Member; Apache Software Foundation; http://www.apache.org/
Visiting Lecturer; University of Moratuwa; http://www.cse.mrt.ac.lk/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.