DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14875>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14875

NullPointerException in XPath API





------- Additional Comments From [EMAIL PROTECTED]  2002-12-09 22:06 -------
You should NOT use XPathAPI in your extension element. XPathAPI creates its own 
DTMManager, which is different from the one used for the original document.

You can replace the call
  xpathNodes = XPathAPI.selectNodeList(context.getContextNode(), xpathQuery);
by something like this:
                XPathContext xpathContext = context.getTransformer
().getXPathContext();
                XPath xpath = new XPath(xpathQuery, null, 
xpathContext.getNamespaceContext(), XPath.SELECT);
                XObject object = xpath.execute(xpathContext, 
xpathContext.getContextNode(), xpathContext.getNamespaceContext());
                xpathNodes = object.nodelist();

Also you cannot create a new element under the extElement. You can use a 
DocumentBuilder to create it instead.

Reply via email to