Bug 50289 - xslt task does not use the classpath attribute to find XSLT processor
Summary: xslt task does not use the classpath attribute to find XSLT processor
Status: RESOLVED DUPLICATE of bug 49271
Alias: None
Product: Ant
Classification: Unclassified
Component: Core tasks (show other bugs)
Version: 1.8.1
Hardware: All All
: P2 normal (vote)
Target Milestone: ---
Assignee: Ant Notifications List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-17 21:58 UTC by Hoylen Sue
Modified: 2010-11-18 10:03 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hoylen Sue 2010-11-17 21:58:03 UTC
Overview:

The XSLT task <http://ant.apache.org/manual/Tasks/style.html> has an optional "classpath" attribute for specifying the "the classpath to use when looking up the XSLT processor".

This is not happening and any XSLT processor is referenced by the classpath attribute is not getting used.


STEPS TO REPRODUCE

Detailed steps were written in: https://issues.apache.org/bugzilla/show_bug.cgi?id=41314 (along with sample files).  Essentially, trying to reference an XSLT 2.0 processor (namely SAXON) in the classpath attribute.

Actual results: the task uses the default Java XSLT processor (which is an XSLT 1.0 processor).

Expected results: the task uses the XSLT 2.0 processor found inside the JAR file that is in the classpath attribute.


BUILD

This bug (re)appears in Ant 1.8.1.

This bug is not present in Ant 1.8.0, 1.7.1 and 1.7.0. (Though it runs about 5 times slower on release 1.8.0 than the others.)

Have reproduced this bug in release 1.8.1, and the success of the other releases, on Microsoft Windows XP and Mac OS 10.6.4.


ADDITIONAL INFORMATION

If there is an explicit XSLT factory class specified then the classpath attribute is always not used, even though it is expected that it would be used.

That is, this will work

<xslt ... classpath="/Users/.../saxon9.jar">
</xslt>

but this will not work:

<xslt ... classpath="/Users/.../saxon9.jar">
  <factory name="net.sf.saxon.TransformerFactoryImpl"/>
</xslt>

even though the first example should be implicitly picking the class which was explicitly specified in the second example.

This problem with an explicit factory occurs with release 1.8.1 as well as in 1.8.0, 1.7.1 and 1.7.0.  So it seems the code for using the classpath attribute is conditional on whether a factory element exists or not.
Comment 1 Jesse Glick 2010-11-18 10:03:36 UTC
Check in 1.8.2 dev builds.

*** This bug has been marked as a duplicate of bug 49271 ***