Apr 9th, 2007, 01:11 PM
Read/Write to XML file
I have the need to read *and* update an xml file. Something like you would do if using apache xmlbeans. I'm aware of Spring's ability to read map elements, etc. from the app context but I really just want an easy way to marshal an xml file into a javabean and then write the updates back to that xml file. What's the best way to do this?
I saw some documentation about a wrapper class for xmlbeans but it looks as it is deprecated.
Any help is appreciated.
Apr 10th, 2007, 06:44 AM
I have read a few threads that talk about writing out the applicationContext, but I've not seen any solutions as yet.
Apr 11th, 2007, 08:16 AM
better go for the age old SAXParser, DOMParser for reading/writing XML files using Java.
Apr 11th, 2007, 11:57 AM
It might be worth hunting down the threads I mentioned to see if there were any thoughts that might have been useful in solving the problem.
Apr 11th, 2007, 01:13 PM
You might want to take a look at Spring Web Services. The Object-XML mapping functionality there should help you there. I've asked Arjen to tune in as well...
Apr 11th, 2007, 01:14 PM
It would be great if there was a good solution for this one. It has been asked quite a few times in the past few months and is a pretty good candidate for an FAQ question.
Apr 11th, 2007, 01:16 PM
You can find information about the O/X mapping framework here: http://static.springframework.org/sp...html/ch05.html