Thank you Henry, that worked. (i don't have it in endorsed, btw) But having 
done that it still results in a NullPtrException the same as when i used new 
XPatchFactoryImpl, here

because the dtm is null, HERE

public void setRoot(int root)
  {
    // %OPT% Get this directly from the lpi.
    XPathContext xctxt = wi().getXPathContext();
    m_dtm = xctxt.getDTM(root);
    m_traverser = m_dtm.getAxisTraverser(m_axis);  /* HERE m_dtm is null */
    m_isFresh = true;
    m_foundLast = false;
    m_root = root;
    m_currentNode = root;

    if (DTM.NULL == root)
    {
      throw new RuntimeException(
        
XSLMessages.createXPATHMessage(XPATHErrorResources.ER_SETTING_WALKER_ROOT_TO_NULL,
 null)); //"\n !!!! Error! Setting the root of a walker to null!!!");
    }

    resetProximityPositions();
  }


AxesWalker.setRoot(int) line: 221 
WalkingIterator.setRoot(int, Object) line: 157 
XNodeSet(NodeSequence).setRoot(int, Object) line: 265 
WalkingIterator(LocPathIterator).execute(XPathContext) line: 212 
XPath.execute(XPathContext, int, PrefixResolver) line: 337 
XPath.execute(XPathContext, Node, PrefixResolver) line: 303 
XPathImpl.eval(String, Object) line: 216 
XPathImpl.evaluate(String, Object, QName) line: 281 
ExtensionsWithXPath.exfunc(ExpressionContext) line: 28 
NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available 
[native method] 
NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39 
DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25 
Method.invoke(Object, Object...) line: 585 
ExtensionHandlerJavaClass.callFunction(String, Vector, Object, 
ExpressionContext) line: 401 
ExtensionHandlerJavaClass.callFunction(FuncExtFunction, Vector, 
ExpressionContext) line: 440 
ExtensionsTable.extFunction(FuncExtFunction, Vector, ExpressionContext) line: 
222 
TransformerImpl.extFunction(FuncExtFunction, Vector) line: 473 
FuncExtFunction.execute(XPathContext) line: 208 
FuncExtFunction(Expression).executeCharsToContentHandler(XPathContext, 
ContentHandler) line: 313 
ElemValueOf.execute(TransformerImpl) line: 274 
ElemApplyTemplates.transformSelectedNodes(TransformerImpl) line: 395 
ElemApplyTemplates.execute(TransformerImpl) line: 178 
TransformerImpl.executeChildTemplates(ElemTemplateElement, boolean) line: 2400 
TransformerImpl.applyTemplateToNode(ElemTemplateElement, ElemTemplate, int) 
line: 2270 
TransformerImpl.transformNode(int) line: 1356 
TransformerImpl.transform(Source, boolean) line: 709 
TransformerImpl.transform(Source, Result, boolean) line: 1273 
TransformerImpl.transform(Source, Result) line: 1251 
ExtensionsWithXPath.main(String[]) line: 21 



  ----- Original Message ----- 
  From: Henry Zongaro 
  To: [EMAIL PROTECTED] 
  Cc: xalan-j-users@xml.apache.org 
  Sent: Saturday, February 09, 2008 7:25 AM
  Subject: RE: XPath in extension functions 'Could not resolve the node to a 
handle'



  Hi, Dave. 

  "Dave Brosius" <[EMAIL PROTECTED]> wrote on 2008-02-08 06:42:13 PM:
  > Some further snooping reveals, that i am using the 
  > com.sun.org.apache.xpath.internal.jaxp.XPathFactoryImpl
  > 
  > factory, even tho i have xalan.jar on my path. Further when i set this
  > 
  >        System.setProperty("javax.xml.xpath.XPathFactory", "org.
  > apache.xpath.jaxp.XPathFactoryImpl");
  > 
  > I still am getting the sun factory.
  > 
  > I am assuming this is the root of the problem. How do i get the 
  > apache one? I even set the property on the cmd line to no avail.

  XPathFactory allows for different factories based on the input data model.  I 
believe the actual system property you set should be: 

  System.setProperty("javax.xml.xpath.XPathFactory:" 
      +XPathConstants.DOM_OBJECT_MODEL, 
      "org.apache.xpath.jaxp.XPathFactoryImpl"); 

  Also, is xalan.jar merely on your class path or have you used the Java 
endorsed standards override mechanism?  See [1] for more information. 

  Thanks,

  Henry 
  [1] http://xml.apache.org/xalan-j/faq.html#faq-N100EF
  ------------------------------------------------------------------
  Henry Zongaro      XSLT Processors Development
  IBM SWS Toronto Lab   T/L 313-6044;  Phone +1 905 413-6044
  mailto:[EMAIL PROTECTED] 

Reply via email to