You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Mathieu Peltier <Ma...@inrialpes.fr> on 2001/11/07 12:12:37 UTC
pb with the style task (classpath attribute doens't work?)
Hi,
Sorry to post again this question. I work with the style task with Ant 1.4.1. I
don't understand how to use the classpath attribute: in the documentation it is
said that this attribute is used to set (since 1.4) "the classpath to use when
looking up the XSLT processor.", but it doesn't work for me:
here is a test (The file xalan.jar, build.xml, test.xml and stylesheet.xsl are
in the same directory) (my global CLASSPATH variable is empty):
------------------------------------------- build.xml
<project default="test" basedir=".">
<target name="test">
<style basedir="."
destdir="."
classpath="./xalan.jar"
extension=".html"
style="stylesheet.xsl"
includes="test.xml">
</style>
</target>
</project>
------------------------------------------- end build.xml
------------------------------------------- stylesheet.xsl
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html" encoding="iso-8859-1" indent="yes" doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"/>
<xsl:template match="*|@*">
<xsl:copy>
<xsl:apply-templates select="@*|*|text()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
------------------------------------------- stylesheet.xsl
------------------------------------------- test.xml
<html>
<header><title>test</title></header>
<body><p>I have a dream</p></body>
</html>
------------------------------------------- end test.xml
----------------------------------------------------------------------
> ant
Buildfile: build.xml
test:
[style] DEPRECATED - xslp processor is deprecated. Use trax or xalan instead.
[style] java.lang.NoClassDefFoundError: org/apache/xalan/xslt/XSLTProcessorFactory
[style] at org.apache.tools.ant.taskdefs.optional.XalanLiaison.<init>(XalanLiaison.java:82)
[style] at java.lang.Class.newInstance0(Native Method)
[style] at java.lang.Class.newInstance(Class.java:237)
[style] at org.apache.tools.ant.taskdefs.XSLTProcess.resolveProcessor(XSLTProcess.java:278)
[style] at org.apache.tools.ant.taskdefs.XSLTProcess.getLiaison(XSLTProcess.java:406)
[style] at org.apache.tools.ant.taskdefs.XSLTProcess.execute(XSLTProcess.java:141)
[style] at org.apache.tools.ant.Task.perform(Task.java:217)
[style] at org.apache.tools.ant.Target.execute(Target.java:184)
[style] at org.apache.tools.ant.Target.performTasks(Target.java:202)
[style] at org.apache.tools.ant.Project.executeTarget(Project.java:601)
[style] at org.apache.tools.ant.Project.executeTargets(Project.java:560)
[style] at org.apache.tools.ant.Main.runBuild(Main.java:454)
[style] at org.apache.tools.ant.Main.start(Main.java:153)
[style] at org.apache.tools.ant.Main.main(Main.java:176)
[style] java.lang.NoClassDefFoundError: com/kvisco/xsl/XSLProcessor
[style] at org.apache.tools.ant.taskdefs.optional.XslpLiaison.<init>(XslpLiaison.java:77)
[style] at java.lang.Class.newInstance0(Native Method)
[style] at java.lang.Class.newInstance(Class.java:237)
[style] at org.apache.tools.ant.taskdefs.XSLTProcess.resolveProcessor(XSLTProcess.java:274)
[style] at org.apache.tools.ant.taskdefs.XSLTProcess.getLiaison(XSLTProcess.java:403)
[style] at org.apache.tools.ant.taskdefs.XSLTProcess.execute(XSLTProcess.java:141)
[style] at org.apache.tools.ant.Task.perform(Task.java:217)
[style] at org.apache.tools.ant.Target.execute(Target.java:184)
[style] at org.apache.tools.ant.Target.performTasks(Target.java:202)
[style] at org.apache.tools.ant.Project.executeTarget(Project.java:601)
[style] at org.apache.tools.ant.Project.executeTargets(Project.java:560)
[style] at org.apache.tools.ant.Main.runBuild(Main.java:454)
[style] at org.apache.tools.ant.Main.start(Main.java:153)
[style] at org.apache.tools.ant.Main.main(Main.java:176)
BUILD FAILED
/home/web/src/essai/build.xml:10: javax.xml.transform.TransformerFactoryConfigurationError: Provider org.apache.xalan.processor.TransformerFactoryImpl not found
Total time: 0 seconds
----------------------------------------------------------------------
When I add processor="trax" (the default?!) in the build.xml file, I have the
following output:
------------------------------------------------------------------------------
> ant
Buildfile: build.xml
test:
BUILD FAILED
javax.xml.transform.TransformerFactoryConfigurationError: Provider org.apache.xalan.processor.TransformerFactoryImpl not found
at javax.xml.transform.TransformerFactory.newInstance(TransformerFactory.java:110)
at org.apache.tools.ant.taskdefs.optional.TraXLiaison.<init>(TraXLiaison.java:93)
at java.lang.Class.newInstance0(Native Method)
at java.lang.Class.newInstance(Class.java:237)
at org.apache.tools.ant.taskdefs.XSLTProcess.resolveProcessor(XSLTProcess.java:269)
at org.apache.tools.ant.taskdefs.XSLTProcess.getLiaison(XSLTProcess.java:394)
at org.apache.tools.ant.taskdefs.XSLTProcess.execute(XSLTProcess.java:141)
at org.apache.tools.ant.Task.perform(Task.java:217)
at org.apache.tools.ant.Target.execute(Target.java:184)
at org.apache.tools.ant.Target.performTasks(Target.java:202)
at org.apache.tools.ant.Project.executeTarget(Project.java:601)
at org.apache.tools.ant.Project.executeTargets(Project.java:560)
at org.apache.tools.ant.Main.runBuild(Main.java:454)
at org.apache.tools.ant.Main.start(Main.java:153)
at org.apache.tools.ant.Main.main(Main.java:176)
Total time: 0 seconds
Provider org.apache.xalan.processor.TransformerFactoryImpl not found
------------------------------------------------------------------------------
When I put xalan.jar in the ant lib directory or when I set my global CLASSPATH
variable, it works but it is not what I want to do.
Thank you for help.
--
Mathieu Peltier
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>