|
Subject:
|
need help with editing an XML file using Java
|
|
Posted By:
|
Pesho_318i
|
Post Date:
|
6/16/2006 6:33:20 AM
|
Hello all,
I guess my question is simple, but I'm not experienced enough with Java and XML.
What I want to do is read an XML file then change some of the attributes and finally output it to a file again. (if possible using the DOM Java parser)
I don't know which Java tools to use about changing the content of an XML file.
hope you know the solution, Best, Pesho
|
|
Reply By:
|
mhkay
|
Reply Date:
|
6/16/2006 6:35:52 AM
|
Why do you want to do this in Java? The tool for the job is XSLT.
Michael Kay http://www.saxonica.com/ Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
|
|
Reply By:
|
bhavesh bhanushali
|
Reply Date:
|
6/16/2006 8:13:30 AM
|
If u dont want to use XSLT u could write a transformer in java that could change the attributes u want in the XML file and then write the required contents back to the XML file . This can be done using DOM or SAX. I have implemented a similar thing in DOM .
|
|
Reply By:
|
vinitpugaliya
|
Reply Date:
|
1/8/2007 5:33:18 AM
|
hi, Even i am facing the same problem, If any one can provide me code to add new node to existing XML file it would be gr8. Thanx.
|