This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
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 Building Microservices this week in the Design 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: 32507
    
214

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.)


[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Replace tag value using Ant Script
 
It's not a secret anymore!