tdc
tdc

Reputation: 8607

ant [xslt doesn't support the "failOnTransformationError" attribute]

I'm trying to run an ant XSLT on a large number of files, but it's failing halfway through. I'd like to use the "failOnTransformationError" attribute but I get the following error:

xslt doesn't support the "failOnTransformationError" attribute

My build file looks lie:

<project>
    <xslt
            basedir="xmldir"
            destdir="textdir"
            includesfile="includefile.txt"
            extension=".txt"
            style="style.xsl"
            force="true"
            failOnTransformationError="false"
            >
    <outputproperty name="encoding" value="UTF-8"/>
    </xslt>
</project>

I've also tried running using different processors via the -lib option ,i.e

ant -lib /usr/share/java/saxon-6.5.5.jar
ant -lib /usr/share/java/saxonb-9.0.jar
ant -lib /usr/share/java/saxon.jar
ant -lib /usr/share/java/saxonb-ant.jar

but no luck. I also tried inserting

<classpath location="/usr/share/java/saxonb-9.0.jar"/>

or

<factory name="net.sf.saxon.TransformerFactoryImpl"/>

into the xslt declaration but these had no effect either.

I saw this page http://www.abbeyworkshop.com/howto/xslt/ant-saxon/index.html which simply uses the classpath location. I noticed that the xslt in that case is wrapped by

<target name="xslt2">
 ...
</target>
<target name="TransformAll" depends="xslt2" />

but when I put that into my build file nothing happens (actually, it says "success" but doesn't build any of the files).

I'm running Ubuntu 10.04.3, Apache Ant version 1.7.1

Any clues how to make this work, or any other way to make ant ignore errors (and write them to a log file)?

Upvotes: 2

Views: 211

Answers (2)

Michael Kay
Michael Kay

Reputation: 163342

There's a long history of ant bugs in this area (I suspect they don't have a very good regression testing suite). See for example

How to execute XSLT 2.0 with ant?

and the things it links to.

Upvotes: 0

JB Nizet
JB Nizet

Reputation: 691775

failOnTransformationError exists since Ant 1.8, as mentioned in the doc. Are you sure your ant version isn't less than that?

Use ant -version to know.

Upvotes: 3

Related Questions