gpt4 book ai didi

java - XSLT/Java : ERROR: 'Cannot find external method ' max' (must be public). '

转载 作者:行者123 更新时间:2023-11-30 05:17:09 25 4
gpt4 key购买 nike

我正在复制 XSLT Cookbook: 2nd Edition 中的示例(O'Reilly:Mangano,2006)Mangano 使用 SVG 创建树形图。作为快速测试此代码的一种方法,我只是使用 JSTL 的 <x:transform/> 转换 XML。标签,并在 Jetty 6 中运行它。XSLT 似乎在调用 java:java.lang.Math:max 时挂起。 ,说:

ERROR: 'Cannot find external method 'max' (must be public).' FATAL ERROR: 'Could not compile stylesheet'

给我错误的代码包含在此处 ...Math:max(...称为:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.1"
xmlns:emath="http://www.exslt.org/math"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:tree="http://www.ora.com/XSLTCookboox/ns/tree"
xmlns:xalan="http://xml.apache.org/xslt"
xmlns:Math="xalan:java.lang.Math">
...
<!--Pass 1 copies input with added bookkeeping attributes -->
<xsl:variable name="treeWithLayout">
<xsl:apply-templates mode="layout"/>
</xsl:variable>

<xsl:variable name="maxPos"
select="Math:max($treeWithLayout/*/@tree:WEIGHT *
($nodeWidth + $horzSpace),
$treeWithLayout/*/@tree:MAXDEPTH *
($nodeHeight + $vertSpace))"/>
...

最佳答案

我找到了这个usage online :

<xsl:stylesheet version="1.0" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:math="xalan://java.lang.Math"
extension-element-prefixes="math">

关于java - XSLT/Java : ERROR: 'Cannot find external method ' max' (must be public). ',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/643659/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com