Here is the code for the complete class:
========================
package com.btmna.ratesApp;
import org.apache.xml.dtm.DTM;
import org.apache.xpath.XPathContext;
public class XPathTest {
public XPathTest(){
System.out.println("a");
XPathContext _xpathcont = new XPathContext();
System.out.println("b");
DTM dtm = _xpathcont.createDocumentFragment();
System.out.println("c");
}
public static void main(String[] args){
new XPathTest();
}
}
=====================================
The code above produces the following output:
===============output
a
b
java.lang.NoSuchMethodError
at com.btmna.ratesApp.XPathTest.<init>(XPathTest.java:11)
at com.btmna.ratesApp.XPathTest.main(XPathTest.java:17)
Exception in thread "main"
=======================
I'm using JDK 1.3.0_02 (nothing in lib\ext).
I have xalan.jar,xercesImpl.jar,xml-apis.jar in my classpath.
Cut and paste the code and see if it works for you.
I wish I could see a clear example of how from a DOM object I can use an
XPath expression to get access to a node in the DOM document without using
the XPathAPI. Previously, you mentioned to me that I should use the
nodelist() or nodeset() method of the XObject that is return by the XPath.
However, nodelist()/nodeset() also returns a NoSuchMethodError error. I
would also like to get these values directly from the DTM (once i get past
this).
I plan to have a servelt look up information about a user that is stored in
the DTM. This DTM is based off an DOM document that is also loaded in
memory, whenever changes are made to the DOM (user information is changed)
the DTM will be updated so that I will have the latest info. I would like
to use XPath expression to located the user I wish to update/delete from
the DOM doc. The only reason for the DTM is speed, I'm assuming it should
be faster retrieving data from a DTM than a DOM document.
"Joseph Kesselman/CAM/Lotus" <[EMAIL PROTECTED]> on 04/16/2002
02:34:58 PM
To: "Tito Burgos" <[EMAIL PROTECTED]>
cc:
Subject: Re: NoSuchMethodError on XPathContext
I haven't tried explicitly invoking it, but the method is there and is
public. If you're running against a current version of Xalan, I can't see
any reason you'd have trouble compiling a call to it.