Re: Problem round-tripping with xml.dom.minidom pretty-printer

2008-02-29 Thread Robert Bossy
Ben Butler-Cole wrote: >> An additional thing to keep in mind is that toprettyxml does not print >> an XML identical to the original DOM tree: it adds newlines and tabs. >> When parsed again these blank characters are inserted in the DOM tree as >> character nodes. If you toprettyxml an XML documen

Re: Problem round-tripping with xml.dom.minidom pretty-printer

2008-02-29 Thread Ben Butler-Cole
> The last line of p() calls itself: it is an unconditional recursive call > so, no matter what it does, it will never stop. And since p() also > prints something, calling it will print endlessly. Sorry, I wasn't clear. I realize that this recurses endlessly. The problem is that it also adds blank

Re: Problem round-tripping with xml.dom.minidom pretty-printer

2008-02-29 Thread Robert Bossy
Ben Butler-Cole wrote: > Hello > > I have run into a problem using minidom. I have an HTML file that I > want to make occasional, automated changes to (adding new links). My > strategy is to parse it with minidom, add a node, pretty print it and > write it back to disk. > > However I find that ever