Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Can anyone help when using jaxen and jdom?

843834May 20 2003 — edited May 21 2003
I am new to jaxen and jdom.I am now starting to learn it.and following the example of the jaxen. I run the following code however too many exceptions were catched.Can anyone give me some suggestion and directions.Any help will be appreciated. The code:
try{
SAXBuilder builder = new SAXBuilder();
org.jdom.Document doc = builder.build(new File("c:/URQ/ResourcLib.xml"));

Element elem = doc.getRootElement();
XPath xpath = new JDOMXPath("//Name");
List results = xpath.selectNodes(doc); //here exceptions were catched
...
}
the code can be compiled But when rut it.errors happened
The exception is:
java.lang.NoSuchMethodError
at org.jaxen.jdom.DocumentNavigator.getChildAxisIteratorx (DocumentNavigator.java:197)
at org.jaxen.util.DescendantAxisIterator.createIterator(DescendantAxisIterator.java:89)
at org.jaxen.util.StackedIterator.internalCreateIterator(StackedIterator.java:118)
at org.jaxen.util.StackedIterator.init(StackedIterator.java:106)
at org.jaxen.util.DescendantOrSelfAxisIterator.(DescendantOrSelfAxisIterator.java:85)
at org.jaxen.DefaultNavigator.getDescendantOrSelfAxisIterator(DefaultNavigator.java:183)
at org.jaxen.expr.iter.IterableDescendantOrSelfAxis.iterator(IterableDescendantOrSelfAxis.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(DefaultAbsoluteLocationPath.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)
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 18 2003
Added on May 20 2003
3 comments
203 views