The source distro contains an "embed" directory [1] where someone played
(a long time ago) with iterating over xml using xpath. What it does:
- create a new PropertyHelper (datatype)
- register that (using a task)
- use a special property syntax
${ prefix : xmldocument / xpath}
${jxpath:/references/module.xml/root/module/project[1]/@name}
Last year (or so) I played with that and got good results. Last time when
I did that I got only errors. But I havent spent more time on that, so I
dont know if it works any more ... but you should have a look
A complete different way would be trying to create a list of values
(value1;value2;...) so you could use AntContribs for/foreach task. Maybe you
could print out the props into a file using <echoproperties> with prefix,
then
using <replaceregexp> for changing the ${line.separator} to ";" ...
Jan
[1] http://cvs.apache.org/viewcvs.cgi/ant/proposal/embed/
> -----Urspr�ngliche Nachricht-----
> Von: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]
> Gesendet am: Mittwoch, 8. September 2004 00:38
> An: [EMAIL PROTECTED]
> Betreff: How to organize project properties.
>
> This is more of a data organization question rather than ant question.
> I want to keep all configuration data in a sepreate properties file.
> either plain text or preferably XML.
> say for plain text
>
> #sys-name java-src jsp-src java-dest jsp-comp-dest
> system1 /proj1/src /proj1/jsp /proj1/classes /proj1/servlets
> system2 /proj2/src /proj2/jsp /proj2/classes /proj2/servlets
>
> The XML file can be something like
> <systems>
> <system value="system1">
> <java-src value="/proj1/src" />
> ....
> </system>
> <system...
> </system>
> </systems>
>
> Now my main build script should either iterate over the
> entire set or a
> specified set or a single system and
> carry out certain sequential tasks.
> I have tried to use <xmlproperty> task to initialise, but how do I
> iterate. for e.g.
> in first loop the property systems.system.java-src should be
> /proj1/src ,
> while in second iteration it
> should be /proj2/src.
> Is this doable, any other alternatives that you may have implemented ?
> thanks
> bhaskar
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>