ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Huditsch Roman" <Roman.Hudit...@lexisnexis.at>
Subject AW: Converting new or changed files with an batch file called from within ant
Date Tue, 12 Apr 2005 14:11:36 GMT
Hi Jim,

Thanks a lot for your solution.
I'll straigth dive into it tomorrow morning.
Thanks!

wbr,
Roman

_______________________________________

Roman Huditsch
IT and Electronic Publishing
LexisNexis ARD Orac 
Marxergasse 25
1030 Vienna
Austria 
ph: +43-1-534 52-1514
f: +43-1-534 52-140
e-mail roman.huditsch@lexisnexis.at
www.lexisnexis.at
 

> -----Urspr√ľngliche Nachricht-----
> Von: James Fuller [mailto:jim.fuller@ruminate.co.uk] 
> Gesendet: Dienstag, 12. April 2005 16:10
> An: Ant Users List
> Betreff: Re: Converting new or changed files with an batch 
> file called from within ant
> 
> 
> you could do something like
> 
> <?xml version='1.0'?>
> 
> <project name='transform' default='build' basedir=".">
> 
>   <taskdef resource="net/sf/antcontrib/antcontrib.properties"/>
> 
>   <property name="jar.saxon" location="/opt/saxon/saxon8.jar"/>
>  
>  
>   <macrodef name="transform">
>     <attribute name="src"/>
>     <attribute name="dest"/>
>     <attribute name="style"/>
>     <sequential>
>      
>       <mkdir dir="@{dest}"/>
>     
>       <uptodate property="transform.notRequired">
>         <srcfiles dir= "@{src}" includes="**/*.xml"/>
>         <mapper type="merge" to="@{dest}/**/*.html"/>
>       </uptodate>
>  
>       <if>
>         <equals arg1="${transform.notRequired}" arg2="true" />
>         <then>
>           Transform not required
>         </then>
>         <else>
> 
>       <xslt in="@{src}"
>             out="@{dest}"
>             style="@{style}"
>             extension=".html"
>             includes="**.xml"
>             basedir=".">
>        
>         <outputproperty name="method" value="xml"/>
>         <outputproperty name="standalone" value="yes"/>
>         <outputproperty name="encoding" value="iso8859_1"/>
>         <outputproperty name="indent" value="yes"/>
>    
>         <classpath>
>           <pathelement location="${jar.saxon}"/>
>         </classpath>
>       </xslt>
>          
>         </else>
>       </if>
>     </sequential>
>   </macrodef>
>  
>  
>   <target name='build'>
>     <transform src="test" dest="webroot" style="xsl/index.xsl"/>
>   </target>
> 
> </project>
> 
> using ant-contrib's if task....once again u still only get 
> dir by dir checking, this could easily be customised to work 
> on a per file basis (then iterate using <for/> task)...though 
> as you can see things get more procedural..
> 
> gl, Jim Fuller
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For 
> additional commands, e-mail: user-help@ant.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message