ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject RE: Combine Apply + XSLT task
Date Fri, 26 Nov 2004 15:12:32 GMT
"Robert Soesemann" <> wrote ..
> In the ant-contrib manual is no example for the foreach task. Can
> anybody give an example of how to iterate e.g. over all .xml files in a
> folder structure.
> I also could not find out how to get the path and name of the currently
> iterated file.
> What I need is something like: (pseudocode)
> Foreach file of type **/*.xml in dir X do
>   Store Property path = file + file_path
>   Proccess file with xyz.xsl and store result in dir YXZ
> End do

if you dont want to constrain yourself to calling a target your could do something using the

<for param="infile">
    <fileset dir="${xslt.dir}" includes="*.xml"/>
 <xslt in="@{infile}" out="@{infile}.html"
  <outputproperty name="method" value="xml";/>
  <outputproperty name="standalone" value="yes"/>
  <outputproperty name="encoding" value="iso8859_1"/>
  <outputproperty name="indent" value="yes"/>

untested, but should work.

--Jim Fuller

View raw message