tags:

views:

419

answers:

2

I would have thought that if you didn't provide a destination, xmltask would modify the source file and replace it, but apparently that's not the case since the below code does not work:

<xmltask source="**\plugin.xml"> 
 <attr path="plugin" attr="version" value="12345" /> 
</xmltask>

If I specify a destination, I get an error saying "Multiple inputs, but only one destination":

<xmltask source="**\plugin.xml" dest="**\plugin.xml"> 
 <attr path="plugin" attr="version" value="12345" /> 
</xmltask>

How can I get this to work with wildcards? Is it possible?

+1  A: 

Instead of specifying a single output file with dest, specify an output directory with todir:

<xmltask source="**\plugin.xml" todir="output"> 
   <attr path="plugin" attr="version" value="12345" /> 
</xmltask>
Peter Hilton
A: 

if I add the 'todir' attribute, xmltask will preserve the file name, but will output all the files to that one location, which is not what I want.

Is there some way to have xmltask just modify an xml file in place without having to change its location? If xmltask must re-write the file, is there some way to synch the 'todir' attribute with the directory of the source file so it just writes it to the same location?

If you specify the source and destination to be the same, it will read/write to the same file reliably.
Brian Agnew