aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes Replace tag value using Ant Script Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Replace tag value using Ant Script" Watch "Replace tag value using Ant Script" New topic
Author

Replace tag value using Ant Script

Madhumathy Viswanathan
Greenhorn

Joined: Jun 01, 2005
Posts: 6
Do anybody know how to replace a child tag value based on the parent tag�s attribute using ant script.
Example,
...
<host name="123">
<alias>Hello</alias>
</host>
<host name="xyz">
<alias>abc</alias>
</host>...
I have to replace the value of alias tag based on the name of host tag
<host name="123">
<alias>Good Morning</alias>
</host>

Could anybody help me in this?

Appreciate your help.


Madhumathy
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30758
    
156

Madhumathy,
Take a look at this thread from when I was trying to do the same thing a few months ago. (The later posts in thread are more relevant.)


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Replace tag value using Ant Script