This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Servlets and the fly likes Modifying XML File using JDOM Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "Modifying XML File using JDOM" Watch "Modifying XML File using JDOM" New topic
Author

Modifying XML File using JDOM

Nirban Dutta
Greenhorn

Joined: Jun 20, 2001
Posts: 9
I am using JDOM for manipulating my external XML file from within JSP. For retrieving information, it is working fine, but while modifying the Text of an element, it is not chaning the text , also it is not showing any error.
I have used both SAXBuilder and DOMBuilder classes and tried to change the text of particular element like:
Element nm = pt.getChild("name");
//where pt is the parent element of element "name"
nm = nm.setText("New Name");
But its not changing the text of the element to "New Name".
Can anyone help me?
Thanx in advance
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040

IMHO, you may be able to get a quicker response in the
XML forum.
Since we have JSPs involved, its seems okay in this
forum also.
regds.
- satya

Take a Minute, Donate an Hour, Change a Life
http://www.ashanet.org/workanhour/2006/?r=Javaranch_ML&a=81
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Modifying XML File using JDOM
 
Similar Threads
Displaying XML as XML in HTML
Modifying XML content using JDOM
Transform text file to xml
Query about jDOM.
Trouble with Embedded HTML during XSLT Transformation using JDOM