Hi all,
I started to use AXIOM in Forrest to replace some old DOM code that is
still lurking around.
Now I am trying to select a node with a given xpath:
...
String xlocation = iterator.next();
AXIOMXPath xpath = new AXIOMXPath(xlocation);
OMElement injection = (OMElement)xpath.selectSingleNode(root);
...
if(null==injection){
log.debug("Path is not already contained, "+
"so we need to create it.");
}
...
I searched a bit in the code but could not find any method that will
create a element if the xpath expression is not given. Well much like:
http://cocoon.apache.org/2.1/apidocs/org/apache/cocoon/xml/dom/DOMUtil.html#selectSingleNode(org.w3c.dom.Node,
java.lang.String, org.apache.excalibur.xml.xpath.XPathProcessor) but only for
StAX/Axiom.
I there something that I can reuse?
If not, is there interest that I create a patch for AXIOMXPath and
implement this functionality?
salu2
--
Thorsten Scherler thorsten.at.apache.org
Open Source Java consulting, training and solutions