0

I have a property file which is dynamic, an extract of this file might look like;

 user1=password1
 user2=password2
 user3=password3 

And I have a xml file (which is also dynamic);

<users>
 <user>
 <name>user1</name>
 <credentials>i-need-a-new-password</credentials>
 </user>
 <user>
 <name>user2</name>
 <credentials>i-need-a-new-password</credentials>
 </user>
 <user>
 <name>user3</name>
 <credentials>i-need-a-new-password</credentials>
 </user>
</users>

I need to replace the password for each user found in the property, and has to be replaced in the corresponding user-tag. Please advise

RyanOz
  • 115
  • 1
  • 7
  • Convert the XML file into an XSLT template, then use the ANT task to generate the desired output XML file. If you need something more complex consider embedding a scripting language in your build (for example groovy, which has excellent support for manipulating XML). – Mark O'Connor Apr 23 '14 at 09:53
  • Cheers mate, creating a XSL file, and then using the output xml in my build.xml did the trick. – RyanOz Apr 26 '14 at 13:11

0 Answers0