0

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

3
  • Do you write the DOM back out? Commented Nov 2, 2011 at 15:00
  • Take a look at STAX API Commented Nov 2, 2011 at 15:06
  • i want to avoid using additional apis, is it possible to achieve? basically im just modifying the xml file Commented Nov 2, 2011 at 17:54

1 Answer 1

2

Take a look at this Java Xpath Tutorial

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.