Hello,

I'm cross posting this to the Xalan and Ant lists due to the problem being
one of integration between the two of them. I would like to use Ant to
automate the running of my XSL transformations. I have the binary versions
of Ant 1.2 and Xalan-Java version 2.0.D06 installed in my environment.

The Style task is one of the built-in tasks that comes with Ant. According
to the documentation I have for Ant 1.2, you can specify that you want to
use the Xalan processor as an attribute of the XML element that defines a
Style task like so:

  processor="xalan"

This is supposed to work as long as you provide the Xalan jar file in the
Ant classpath. I have done exactly this and I get the following error:

C:\>ant do-transformations
Searching for build.xml ...
Buildfile: C:\build.xml

do-transformations:

BUILD FAILED

C:\build.xml:5: java.lang.NoClassDefFoundError
: org/apache/xalan/xslt/XSLTProcessorFactory
java.lang.NoClassDefFoundError: org/apache/xalan/xslt/XSLTProcessorFactory
        at
org.apache.tools.ant.taskdefs.optional.XalanLiaison.<init>(XalanLiais
on.java)
        at java.lang.Class.newInstance0(Native Method)
        at java.lang.Class.newInstance(Unknown Source)
        at
org.apache.tools.ant.taskdefs.XSLTProcess.setProcessor(XSLTProcess.ja
va:210)
        at java.lang.reflect.Method.invoke(Native Method)
        at
org.apache.tools.ant.IntrospectionHelper$3.set(IntrospectionHelper.ja
va:352)
        at
org.apache.tools.ant.IntrospectionHelper.setAttribute(IntrospectionHe
lper.java:227)
        at
org.apache.tools.ant.ProjectHelper.configure(ProjectHelper.java:554)
        at
org.apache.tools.ant.RuntimeConfigurable.maybeConfigure(RuntimeConfig
urable.java:134)

My version of Xalan doesn't include
org.apache.xalan.xsl.XSLTProcessorFactory. I suspect this has to do with the
change to TRaX (Transformation API for XML) in Xalan-Java Version 2.

My interpretation of the documentation for the Style task is that I could
provide my own implementation of XSLTLiason and specify that class with full
package specification in the "processor" attribute instead of relying on the
XalanLiason provided with Ant for use when the "processor" attribute is set
to "xalan".

Has anyone else run into this problem? Has anyone written an implementation
of XSLTLiason for Ant that works with the latest release of Xalan-Java
Version 2? Assuming it hasn't been done already, I'd be glad to implement
this and contribute it to the Ant and/or Xalan projects.

Thanks in Advance,

Mike Van Riper <mailto:[EMAIL PROTECTED]>

Reply via email to