File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Ant, Maven and Other Build Tools and the fly likes ant problme Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "ant problme" Watch "ant problme" New topic
Author

ant problme

bob khan
Greenhorn

Joined: Dec 13, 2008
Posts: 1
i have a xml file that i want to change some attributes with specified elements. for example this is my xml file

<root>
<change name="babak" family="xxx"/>
<changeOne name="yyyy" family="kkkk"/>
</root>

i want to change the (change)element and (name) attribute babak--->kabab

first how can i pars the xml file with ant and change my specified attribute?
i need code example. tanx so much
Amit Ghorpade
Bartender

Joined: Jun 06, 2007
Posts: 2716
    
    6

"azzzzz bazzzzzz " please check your private messages for an important administrative matter. You can see them by clicking the My Private Messages link above.


SCJP, SCWCD.
|Asking Good Questions|
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

Hi Bob,

You can use property ${} or @@ style replacement in ANT. Please see their documentation


Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
 
 
subject: ant problme
 
Similar Threads
Problem starting JBOSS 4.2.3
Mr. Hanna, Followed Your Advice On Custom Tag, Same Error Message
It's boring, XSLT ...
Creating XML from folder
modify the value of an existing attribute in XSLT