Hello
I have a problem with jaxen, when I try to use the XPath function parent :
When I try this :
The first result is well displayed, but just before the second, I catch this exception:
Exception in thread "main" java.lang.NoSuchMethodError: org.jdom.Element.getParent()Lorg/jdom/Element; at org.jaxen.jdom.DocumentNavigator.getParentAxisIterator(DocumentNavigator.java: 252)
at org.jaxen.expr.iter.IterableParentAxis.iterator(IterableParentAxis.java:82)
at org.jaxen.expr.DefaultStep.axisIterator(DefaultStep.java:139)
at org.jaxen.expr.DefaultLocationPath.evaluate(DefaultLocationPath.java:188)
at org.jaxen.expr.DefaultAbsoluteLocationPath.evaluate(DefaultAbsoluteLocationPat h.java:126)
at org.jaxen.expr.DefaultXPathExpr.asList(DefaultXPathExpr.java:107)
at org.jaxen.BaseXPath.selectNodesForContext(BaseXPath.java:716)
at org.jaxen.BaseXPath.selectNodes(BaseXPath.java:239)
at org.jaxen.BaseXPath.evaluate(BaseXPath.java:196)
at MainTestClass.main(MainTestClass.java:85)
However, the first query works good and I received list so I'm quite sure that it's not a problem of unfindable elements.
Finaly I can't be syccessful to use XPath parent function:
Either I catch an exception, or it returns nothing or empty list
Isn't the XPath syntax correct in my second expression ?
Can we do :
/.../.../parent::* ? ou //individu/parent::* ?
I have a problem with jaxen, when I try to use the XPath function parent :
When I try this :
Code:
import ...
DocumentNavigator dn=new DocumentNavigator();
try {
objet=dn.getDocument("TESTXPath.xml");
apath=dn.parseXPath("/Entry/Resultats/step/Population/individu/*");
result=apath.evaluate(objet);
System.out.println(result);
apath=dn.parseXPath("/Entry/Resultats/step/Population/parent::*");
result=apath.evaluate(objet); // ---> exception
System.out.println(result);
}
catch(Exception e) {
e.printStackTrace();
}
The first result is well displayed, but just before the second, I catch this exception:
Exception in thread "main" java.lang.NoSuchMethodError: org.jdom.Element.getParent()Lorg/jdom/Element; at org.jaxen.jdom.DocumentNavigator.getParentAxisIterator(DocumentNavigator.java: 252)
at org.jaxen.expr.iter.IterableParentAxis.iterator(IterableParentAxis.java:82)
at org.jaxen.expr.DefaultStep.axisIterator(DefaultStep.java:139)
at org.jaxen.expr.DefaultLocationPath.evaluate(DefaultLocationPath.java:188)
at org.jaxen.expr.DefaultAbsoluteLocationPath.evaluate(DefaultAbsoluteLocationPat h.java:126)
at org.jaxen.expr.DefaultXPathExpr.asList(DefaultXPathExpr.java:107)
at org.jaxen.BaseXPath.selectNodesForContext(BaseXPath.java:716)
at org.jaxen.BaseXPath.selectNodes(BaseXPath.java:239)
at org.jaxen.BaseXPath.evaluate(BaseXPath.java:196)
at MainTestClass.main(MainTestClass.java:85)
However, the first query works good and I received list so I'm quite sure that it's not a problem of unfindable elements.
Finaly I can't be syccessful to use XPath parent function:
Either I catch an exception, or it returns nothing or empty list
Isn't the XPath syntax correct in my second expression ?
Can we do :
/.../.../parent::* ? ou //individu/parent::* ?