ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Rich" <billr...@attglobal.net>
Subject RE: foreach parameter does not change
Date Fri, 26 Nov 2004 16:28:55 GMT
In 8_sub use @{file} to access the parameter. HTH

Bill 

-----Original Message-----
From: Robert Soesemann [mailto:rsoesemann@sapient.com] 
Sent: Friday, November 26, 2004 7:46 AM
To: Ant Users List
Subject: foreach parameter does not change

Hello,

In my ant pipeline I have the following 2 targets which perform a foreach on
every xml file in a folder structure. I do it this way to pass the path of
the currently process file to the xsl transformer.
Although the code looks like $file is overwritten each iteration, all my
xmls get the same file parameter.

Any ideas?!

   <!-- ================ Target 8: AddUniqueId  ================ -->
    <target name="8_AddUniqueId" depends="6_AddSchemaDefinitions">
    	
    	<!-- Iterate over all xml files and include path as id via xslt
-->
    	<foreach target="8_sub" param="file" >
    		<path>
    			<fileset dir="${xs_dir}" includes="**/*.xml"/>
    		</path>
    	</foreach>
    </target>	
	
	<!-- Internal subtask call by foreach iterator in target 8 -->
	<target name="8_sub">
		<xslt in="${file}" 
			  basedir="${xs_dir}" 
			  destdir="${id_dir}"
			  style="add-unique-id.xsl"
			  extension=".xml">
			<param name="path" expression="${file}"/> <<---- IT
NEVER CHANGES
		</xslt>
	</target>

Robert

---------------------------------------------------------------------
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