modify « XML file « Java I/O Q&A

1. Modifying XML file directly using java

I have an XML file which looks some thing like

<e lm="aBAgA"><i>aBAg</i><par n="kAl/A__adj"/></e> 
<e lm="aBAgA"><i>aBAg</i><par n="ladak/A__n"/></e>
I want to modify the xml file itself to look something like
<e lm="abcd"><i>abcd</i><par n="abcd__adj"/></e>
<e lm="efgh"><i>efgh</i><par n="efgh__n"/></e>
I need ...

2. How to modify XML file in Java

3. View then modify content of xml file.

I am new in Java world and my background is database admin. What I am trying to achieve here is write a small java scripts code which would open connections.xml allow user to update connection definition. So here is what I do using java scripts, I load the connections.xml: xmlDoc.load("connections.xml"); Then I disply the current conection def: var x=xmlDoc.getElementsByTagName("StringRefAddr"); for (var ...

4. how to modify the xml file

warnerja wrote: No, there is not. An XML file is really at its heart just a text file, and just like you can't simply write a change in the middle of a text file* but rather have to re-write out the entire contents, the same is true for an XML file. I assumed that, since, as I understand it, you have ...