简体   繁体   中英

Ant XSLT task vs. Java task

I've inherited a project which contains an ant build file. We are in the process of upgrading libraries, and when we did our ancient XSLT translator began flaking out. I've attempted to replace the calls with ant's XSLT task, however it throws some errors in our translators (xalan at the command line throws no such error).

Is there a way to use the fileset in combination with a java task? It would sure beat having to repeat the majority of the call umpteen times. The only thing I can really think of is passing a variable to a sub-ant task, but perhaps there is a better way?

Read this carefully in the preamble to the XSLT task:

Note: If you are using JDK 1.4 or higher, this task does not require external libraries not supplied in the Apache Ant distribution. However, often the built in XSL engine is not as up to date as a fresh download, so an update is still highly recommended in particular since the built-in XSLT processors of Java 5 (and to a certain extent Java 6) are known to have serious issues. See Library Dependencies for more information.

If you are running the latest version of Ant, the XSLT task has a classpath/classpathref parameters that supposedly are used to locate the XSLT processor.

Because our project started before 1.8 was released, we've used the "usual" Ant way of supplying such libraries: either by copying them to the ant's lib dir or by supplying -lib switch for the ant call.

Note, for Xalan to work properly you need to add both xalan-XXXjar and xalan-serializer-XXXjar to the classpath.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM