Re: Stacktrace when trying to use XPath

Daniel Dekany <[email protected]>
Newsgroups gmane.comp.web.freemarker.user
Message-ID <[email protected]>
Unfortunately I don't know anything about this Xalan-specific issue,
but I rather always used Jaxen with FreeMarker. I didn't made any
performance tests, but it integrates nicer with FreeMarker. And then
you just don't have to find solution for this Xalan problem.


Thursday, September 3, 2009, 4:13:20 PM, Newman, John W wrote:

> Hello,
>  
> We have instances of org.w3c.dom.Element in the data model.  I can
> use simple expressions like element.Child or element.@ID etc and all
> is working fine.  But if I try to use xpath, i.e.
> element[“count(.//Child[./@flag=1])”] .. I get this stack trace everytime:
>  
> java.lang.RuntimeException: Could not resolve the node to a handle
>   at
> org.apache.xml.dtm.ref.DTMManagerDefault.getDTMHandleFromNode(DTMManagerDefault.java:556)
>   at
> org.apache.xpath.XPathContext.getDTMHandleFromNode(XPathContext.java:154)
>   at
> freemarker.ext.dom.XalanXPathSupport.executeQuery(XalanXPathSupport.java:108)
>   at freemarker.ext.dom.NodeModel.get(NodeModel.java:279) 
>   at freemarker.ext.dom.ElementModel.get(ElementModel.java:130) 
>   at
> freemarker.core.DynamicKeyName.dealWithStringKey(DynamicKeyName.java:136)
>  
> Looking around a bit I’ve seen one other person with this error
> message (not using freemarker), and it was due to the com.sun xalan
> being used.  You can see by the trace that we are using the real
> apache xalan, xalan-2.6.0.jar is on the classpath.  Is that the
> wrong version?  Any ideas what’s happening and how I can fix this so we can use xpath?
>  
> Thanks,
> John
> …

-- 
Best regards,
 Daniel Dekany


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
FreeMarker-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freemarker-user
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.