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
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Reply 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
internet detective
Marshal

Joined: May 26, 2003
Posts: 26201
    
  66

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://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Replace tag value using Ant Script
 
Similar Threads
How to do conditional execution ofa target
urgent help on passing parameters thru ant script
name-from-attribute doubt
Error with XDoclet In Hibernate
How do I sign "jars" in the target directory using Maven?