Java / XSLT:找不到匹配的1参数函数 [英] Java/XSLT: Cannot find a matching 1-argument function

查看:170
本文介绍了Java / XSLT:找不到匹配的1参数函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到以下错误:

javax.servlet.ServletException: Cannot find a matching 1-argument function named {http://exslt.org/dynamic}evaluate()
at org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:841)
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:774)

我的xslt文件的顶部是

The top of my xslt file is

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet 
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
    version="1.0"   
    xmlns:dyn="http://exslt.org/dynamic" 
    extension-element-prefixes="dyn"> 

你知道为什么我会收到这个错误吗?

Do you know why I may be getting this error?

更新

我的XML文件顶部现在可以读取。

The top of my XML file now reads.

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet 
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
     version="1.0"
     xmlns:xalan="http://xml.apache.org/xalan" 
     exclude-result-prefixes="xalan">

我们失败的XML是

<xsl:template name="test">
  <xsl:param name="param" />
  <xsl:value-of select="$param"/>
  <xsl:value-of select="xalan:evaluate($param)"/>
</xsl:template>

此代码适用于运行Tomcat 5.0的一台服务器,但不适用于运行Tomcat 5.5的服务器。我想是因为代码在一台服务器上运行而不是环境问题。

This codes works on one server running Tomcat 5.0 but is not working on a server running Tomcat 5.5. I imagine because the code is working on one server and not it is an environmental problem.

XSLT通过JSP页面应用于XML。对我来说,看起来没有使用xalan.jar文件。 JSP的顶部是:

The XSLT is being applied to the XML via a JSP page. To me it looks like the xalan.jar file is not being used. The top of the JSP is:

<%@page import="javax.xml.transform.*"%>
<%@page import="javax.xml.transform.stream.*"%>
<%@page import="         java.security.Principal,
             java.net.URL, 
             java.net.URLConnection, 
             java.io.InputStream,
             java.io.InputStreamReader,
             java.io.Reader,
             java.io.BufferedReader,
             java.io.File,
             javax.xml.transform.*,
             javax.xml.transform.stream.*,
             javax.xml.transform.*,
             javax.xml.transform.stream.*"%>

更新
问题在于Saxon被选为XML解析器。 Saxon不支持此功能。删除Saxon.jar可以解决问题。

Update The problem is that Saxon is being chosen as the XML parser. Saxon does not support this functionality. Removing the Saxon.jar fixes the problem.

推荐答案

在XSLT中的某个地方,你指的是一个名为{ http://exslt.org/dynamic } evaluate()你并没有给它提供参数的数量预期。

Somewhere in your XSLT you're referring to a function named "{http://exslt.org/dynamic}evaluate()" and you're not giving it the number of arguments it expects.

或者......它无法找到您要添加的扩展程序。

Or... it's unable to find the extensions you're adding.

这篇关于Java / XSLT:找不到匹配的1参数函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆