0
안녕하세요. Eclipse XSL 플러그인에 문제가 있습니다. xml을 출력으로 생성하기 위해 내 xsl에 확장 기능을 사용하고 있습니다. 하지만 난 아래의 오류에 직면하고 있습니다 :Eclipse xslt 플러그인
17:55:38,998 INFO [main] Main - javax.xml.transform.TransformerFactory=org.apache.xalan.processor.TransformerFactoryImpl
17:55:39,001 INFO [main] Main - java.endorsed.dirs=C:\allinone\JRepo\Java\newwork\workspace\.metadata\.plugins\org.eclipse.wst.xsl.jaxp.launching\endorsed
17:55:39,006 INFO [main] Main - launchFile: C:\allinone\JRepo\Java\newwork\workspace\.metadata\.plugins\org.eclipse.wst.xsl.jaxp.launching\launch\launch.xml
17:55:39,506 INFO [main] JAXPSAXProcessorInvoker - Transforming...
(Location of error unknown)javax.xml.transform.TransformerException: Instance method call to method getFruitType requires an Object instance as first argument
17:55:39,528 INFO [main] JAXPSAXProcessorInvoker - Done.
XSL 파일 :
<?xml version="1.0" encoding="UTF-8"?>
<!-- Access packaged method in a class file, assigning the classpath to the prefix.-->
<xsl:stylesheet
version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:fn="http://www.w3.org/2005/xpath-functions"
xmlns:pf="com.altova.extfunc.PackagedfruitStatic">
<xsl:output indent="yes" exclude-result-prefixes="fn pf xsl fo xs"/>
<xsl:template match="/">
<xsl:variable name="myLemon" select="'yellow'" />
<test>
<staticMethod><xsl:value-of select="pf:getFruitType()"/></staticMethod>
</test>
</xsl:template>
</xsl:stylesheet>
자바 클래스 파일 : 이클립스 플러그인에서
package com.altova.extfunc;
public class PackagedfruitStatic {
//static variable
public static String getFruitType()
{
return " Static fruit";
}
}
I 구성된 Xalan을 파서. BTW 나는 이클립스에서 최신 Java EE IDE (Helios)를 사용하고 있습니다.
전적으로 클래스 경로 문제입니다. 소스 파일/jar 파일을 classpath에 추가했습니다. 클래스 경로는 해당 플러그인으로 제공됩니다. (Runas -> XSLT -> classpath – srinannapa