Re: xml : remove a node with dom

2010-10-28 Thread alain walter
Hi, You're right for my post code : I extract it from a more complicated context. However, the solution you propose produce the line not a blank line. Finally, I've found a good solution by using : from xml.dom.ext import PrettyPrint from xml.dom.ext.reader.Sax2 import FromXmlStream dom = FromXm

Re: xml : remove a node with dom

2010-10-28 Thread Stefan Behnel
alain walter, 28.10.2010 11:37: dom = parseString(toxml) self.ApplicationWhitespaceRemoving(dom) print toxml def ApplicationWhitespaceRemoving(self,ele) : from xml.dom import Node for c in ele.childNodes: if c.nodeType == c.TEXT_NODE: if c.nodeValue == "xxx_toremove_xxx"

Re: xml : remove a node with dom

2010-10-28 Thread Diez B. Roggisch
alain walter writes: > Hello, > I have many difficulties to manipulate xml routines. I'm working with > python 2.4.4 and I cannot change to a more recent one, then I use dom > package, why not. > In the following code, I'm trying unsuccessfully to remove a > particular node. It seems to me that i

xml : remove a node with dom

2010-10-28 Thread alain walter
Hello, I have many difficulties to manipulate xml routines. I'm working with python 2.4.4 and I cannot change to a more recent one, then I use dom package, why not. In the following code, I'm trying unsuccessfully to remove a particular node. It seems to me that it should be basic, but it's not. Th