ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Jan.Mate...@rzf.fin-nrw.de>
Subject AW: Using Java xml properties file with Ant
Date Fri, 20 Jul 2007 15:30:46 GMT
>Good question.  Looking at the ant source it looks like the 
>property value is overwritten with the new value concatenated 
>onto the old value with a comma in between.  So the old value is lost.
>
>This is probably not the answer you are looking for but you 
>could use ant contrib's foreach task to iterate over the list 
>of values in temp.properties.entry.
>
>It would be nice if there were a way for the xmlproperty task 
>to create props with an XPath like syntax.  Something like:
>
>temp.properties.entry(key="appName")  would return Name
>
>or even a simple array index, something like:
>
>temp.properties.entry(0)  would return Name as well
>
>But I don't see such a thing.  Maybe we are just missing it.


Without having a look into the source I dont think that you missed
something.

Have a look at this XML

<data>
   <entry one="foo1" two="foo2" three="foo3">foo-text</entry>
   <entry one="bar1" two="bar2" three="bar3">bar-text</entry>
</data>

What is the key? What is the data?
I could think that something like this could be useful:

<xmlproperty file="" prefix="A" key="two" data="three"/>
<xmlproperty file="" prefix="B" key="one" />
A.foo2=foo3
A.bar2=bar3
B.foo1=foo-text
B.bar1=bar-text

You specify the key and the data attributes and get the "hashmap".
Without specifying
the data attribute it defaults to the text().


Jan




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


Mime
View raw message