Code that edits XML documents

"Martin Olsson" <[email protected]>
Newsgroups gmane.text.xml.general
Message-ID <[email protected]>
Hi,

I need to implement a program that modifies an XML file, this file will
frequently also be edited by hand in a plain text editor. Of course, it's
important that the program does not remove or undo any of the hand-edited
changes (xml data, comments or whitespace). I have previously used Xerces
for reading XML.

What library can you recommend for editing/writing XML data? Can Xerces or
some addon do this? Is there anything in the JDK that I missed? Is there
another Apache project for this?

I'm looking for something that is simple, open source and java. Ideally I
would like something that works like this:

void updateXmlTagContent(Sometype document,
                         String xpathSayingWhichTagToUpdate,
                         String newTagContent);

Have anyone seen a library or tool that does this or something similar? It
doesnt have to be based on xpath, any solution that gets the XML document
updated will do.


rgrds,
martin
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.