Vishrut Patel
Vishrut Patel

Reputation: 11

Modifying XML file directly using java

I have an XML file which looks some thing like

<words>
<e lm="aBAgA"><i>aBAg</i><par n="kAl/A__adj"/></e> 
<e lm="aBAgA"><i>aBAg</i><par n="ladak/A__n"/></e>
</words>

I want to modify the xml file itself to look something like

<words>
<e lm="abcd"><i>abcd</i><par n="abcd__adj"/></e>
<e lm="efgh"><i>efgh</i><par n="efgh__n"/></e>
</words>

I need a java code for it. I am able to make the changes, but those changes dont get written to the file words.xml.

Thanks

Upvotes: 0

Views: 843

Answers (1)

hovanessyan
hovanessyan

Reputation: 31423

Take a look at this Java Xpath Tutorial

Upvotes: 2

Related Questions