Java Mailing List Archive

Apache Ant Archive

» Ant Users List
» Ant Developers List
AW: Using Java xml properties file with Ant

AW: Using Java xml properties file with Ant

2007-07-20       - By Jan.Materne@(protected)

>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
>It would be nice if there were a way for the xmlproperty task
>to create props with an XPath like syntax.  Something like:
>"appName")  would return Name
>or even a simple array index, something like:
>  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

Have a look at this XML

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

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

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


To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

©2008 - Jax Systems, LLC, U.S.A.