XML writing and bzr hanging
I was wondering what the best way to do this would be. I want to read an XML file into memory, modify the DOM tree (I can build this myself if I need to), and write the XML data out again, preserving the original formatting wherever possible. This means, of course, that the XML reader has to take into account whitespace and comments originally in the XML file, and have some sort of scheme for generating whitespace so that new tags line up reasonably well with the existing ones.
I don't mind trying to write something like this myself, but I thought I'd ask for opinions before I started. Perhaps something like this already exists? It seems like it would be a relatively common problem.
Also, I was starting a new project the other day, and I decided to use C++ and bzr just to be different (i.e. instead of C and git). But I must have recently upgraded my (Debian Lenny) bzr, because it always hangs while running (pre-commit?) hook number 3/5, and messes up the repository.
I'm assuming that this is a Debian thing, because I've used bzr before and it worked just fine. I'm not expecting much help with this right now, because I haven't posted the error messages (which I do have, in ~/.bazaar.log, just not on this machine). I just thought I would mention it to see if someone else is having similar problems . . . .
[I put these two seemingly different topics into one thread because they pertain to the same program, which I'll probably have more questions about in the future . . . .]