I have a situation where I need to scan through a large number of .xsd files, and replace an instance of a string with another string based on the file name of the current schema being examined.
For example:
I wish to replace the string: ‘DataSet’ in file1.xsd with the string ‘file1DataSet’
I wish to replace the string: ‘DataSet’ in file2.xsd with the string ‘file2DataSet’
and so on until all schemas have been modified.
I would like to know if there is anyway to do this without using the ant-contrib for loops.
You could try the <replace> task if you have a generally good idea how many schemas you have. The <replaceRegex> might be able to do it without looping.
Ant isn’t really a programming language where you can loop. If you can do everything in one pass, that’s great, but once you start really manipulating files, Ant runs into limitations.