xom-interest AT lists.ibiblio.org
Subject: XOM API for Processing XML with Java
List archive
[XOM-interest] adding NamespaceContext.getNamespaces()
- From: Wolfgang Hoschek <wolfgang.hoschek AT mac.com>
- To: xom-interest <xom-interest AT lists.ibiblio.org>
- Subject: [XOM-interest] adding NamespaceContext.getNamespaces()
- Date: Tue, 31 Oct 2006 07:49:36 -0800
I'd really love to reuse nu.xom.XPathContext for XQuery, but to do so realistically one needs a way to get hold of the entire set of stored namespace declarations. For simplicity, I'd advocate to add a single corresponding method to XPathContext:
/**
* Returns the namespace declarations stored in this context.
*
* @return an unmodifiable map of prefix --> URI associations
* where prefix and URI are non-empty strings.
*/
public Map getNamespaces() {
return Collections.unmodifiableMap(this.namespaces);
// return new HashMap(this.namespaces); // less efficient
}
Assuming that happens, it might be considerable to remove the public XPathContext.lookup() method as mostly obsolete - if needed it can be expressed in terms of getNamespaces(). I think there's no compatibility issue since lookup() was only tentatively added in the 1.2 beta series.
Wolfgang.
Being able to iterate over things does make working with XML easier:
for(Node n:message.xpath("muws-p2-xs:StateTransition/*", catalog)) {
SoapElement e=(SoapElement) n;
//act on the element
}
-steve
-
Re: [XOM-interest] adding an iterator() method to nodes
, (continued)
-
Re: [XOM-interest] adding an iterator() method to nodes,
Randall R Schulz, 10/31/2006
-
Re: [XOM-interest] adding an iterator() method to nodes,
Steve Loughran, 10/31/2006
- Re: [XOM-interest] adding an iterator() method to nodes, Randall R Schulz, 10/31/2006
-
Re: [XOM-interest] adding an iterator() method to nodes,
Ed Davies, 10/31/2006
-
Re: [XOM-interest] adding an iterator() method to nodes,
Steve Loughran, 10/31/2006
-
Re: [XOM-interest] adding an iterator() method to nodes,
Christian Vest Hansen, 10/31/2006
- Re: [XOM-interest] adding an iterator() method to nodes, Michael Kay, 10/31/2006
- Re: [XOM-interest] adding an iterator() method to nodes, Steve Loughran, 10/31/2006
-
Re: [XOM-interest] adding an iterator() method to nodes,
Christian Vest Hansen, 10/31/2006
-
Re: [XOM-interest] adding an iterator() method to nodes,
Steve Loughran, 10/31/2006
-
Re: [XOM-interest] adding an iterator() method to nodes,
Steve Loughran, 10/31/2006
-
Re: [XOM-interest] adding an iterator() method to nodes,
Elliotte Harold, 10/31/2006
-
Re: [XOM-interest] adding an iterator() method to nodes,
Steve Loughran, 10/31/2006
-
[XOM-interest] adding NamespaceContext.getNamespaces(),
Wolfgang Hoschek, 10/31/2006
-
Re: [XOM-interest] adding NamespaceContext.getNamespaces(),
Elliotte Harold, 10/31/2006
-
Re: [XOM-interest] adding NamespaceContext.getNamespaces(),
Wolfgang Hoschek, 10/31/2006
-
Re: [XOM-interest] adding NamespaceContext.getNamespaces(),
Elliotte Harold, 10/31/2006
- Re: [XOM-interest] adding NamespaceContext.getNamespaces(), Christian Vest Hansen, 10/31/2006
- Re: [XOM-interest] adding NamespaceContext.getNamespaces(), Elliotte Harold, 10/31/2006
- Re: [XOM-interest] adding NamespaceContext.getNamespaces(), Wolfgang Hoschek, 10/31/2006
- Re: [XOM-interest] adding NamespaceContext.getNamespaces(), Elliotte Harold, 10/31/2006
-
Re: [XOM-interest] adding NamespaceContext.getNamespaces(),
Elliotte Harold, 10/31/2006
-
Re: [XOM-interest] adding NamespaceContext.getNamespaces(),
Wolfgang Hoschek, 10/31/2006
-
Re: [XOM-interest] adding NamespaceContext.getNamespaces(),
Michael Kay, 10/31/2006
- Re: [XOM-interest] adding NamespaceContext.getNamespaces(), Wolfgang Hoschek, 10/31/2006
-
Re: [XOM-interest] adding NamespaceContext.getNamespaces(),
Elliotte Harold, 10/31/2006
-
[XOM-interest] adding NamespaceContext.getNamespaces(),
Wolfgang Hoschek, 10/31/2006
-
Re: [XOM-interest] adding an iterator() method to nodes,
Steve Loughran, 10/31/2006
-
Re: [XOM-interest] adding an iterator() method to nodes,
Randall R Schulz, 10/31/2006
Archive powered by MHonArc 2.6.24.