ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benoit Voisin <>
Subject RE: Iteration on XML data
Date Tue, 10 Dec 2002 16:06:26 GMT
When I have some properties to read from an XML document I usually use an
XSLT to pre-transform it simple java properties file. It works very nicely.
It is very easy to select the data you need in the XSLT and then it is very
easy to read it inside Ant.

You could very easily do a for-each in XSLT to enumerate the filenames
inside a single property that you can use in ant-contrib's <for>

SAMPLE intermediate file:


RQ: not sure the / works in property names but I believe it should


-----Original Message-----
From: Yaron Ruckenstein []
Sent: 10 December 2002 15:34
To: Ant-User
Subject: Iteration on XML data


I would like to implement the following process:
1. Read a list of entries from a file, preferably XML file,
   each entry has the following data:
   - name of a file in the CM
   - name of a CM user
   - name of the file's version in the CM
	<list source="2.5/dev" target="2.5/reg" count="2">
		<file name="cfg/template" isdir="true" user="integ"
		<file name="bin/" user="yaronr"

2. For each such entry, I want to check out the file from
   my development CM project, and check it in the controlled
   CM project, with the relevant data.

My problem is that I don't know how to get the data of each entry.

If I load this example file, the duplicated values are ignored.
If I change the file entry to be file1, file2 ... then I get all the
data but then I have problem accessing it, because I need an iteration

Maybe if I had a "for index=1 to ${count}" then I could build temporary
(using the ant-contrib propertycopy) and then pass them to another target.

I'll be happy to get your help,
Thanks in advance,

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message