[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: ant task

Subject: Re: ant task
From: Michael Schäfer <michael.schaefer@xxxxxxxxxxx>
Date: Wed, 02 Jun 2010 08:57:24 +0200
Re:  ant task
The xslt task provides the basedir and includes attributes you
can use to define a file set like in this snippet from one of
our build files that transforms a set of XML configuration
files:

<xslt style="${xsl}/migrate-config.xsl"
    	classpath="${xslt.engine}"
    	basedir="${user.config.in}" includes="config.*.xml"
    	destdir="${user.config.out}"
    	force="true"
	extension=".xml"
   	>
</xslt>

Results go to the place the destdir attribute specifies.
We're using Ant 1.7.1.

HTH

Michael


Am 02.06.2010 01:17, schrieb Michael Kay:
On 01/06/2010 23:49, Monosij Dutta-Roy wrote:
I am using XSLT / Saxon 9.2 from Ant (using Saxon9-ant) to apply
transforms.
I want to the use fileset task in ant to apply the XSLT to a set of
files in a directory.

Wanted to find out if there would be some examples of this. I am
thinking I need to:
1. send in a value for the 'in' param in the saxon-xslt task.
2. send in a parallel value for the 'out' paramter or modify the 'out'
parameter according to the name of the file.

My calls from Ant are working fine - just need to apply the transforms
to a set of files in a directory. If there is another approach to the
above please let me know.

Firstly, I don't recommend using the Saxon Ant XSLT task. Use the
standard XSLT task instead, specifying Saxon
(net.sf.saxon.TransformerFactoryImpl) as the JAXP transformer factory.
Two reasons (a) it was never possible to test the Saxon task thoroughly
enough, because there's no test suite available, so many regression bugs
were introduced inadvertently, (b) the original justification for it has
disappeared, since everything you might want to control in the
transformation (e.g. initial template name, initial mode, etc etc) is
now available through properties on the JAXP factory which the standard
task can set.

That then leaves your question about applying the transformation to a
set of files. I'm afraid that's something I haven't attempted to do at
the ant level. It's easy enough to do it at the XSLT level by processing
a collection().

Regards,

Michael Kay
Saxonica

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.