Manlio Perillo <> wrote:
> for n in node.childNodes:
> if n.nodeType in (dom.Node.TEXT_NODE, dom.Node.CDATA_SECTION_NODE):
(Aside: node.TEXT_NODE would probably be better here. Can't guarantee
that a DOM's implementation of the 'Node' interface is available as a
class called 'Node' inside its module.)
> L.append(n.data)
> else:
> if not recursive:
> return None
Surely 'continue'? This will exit the function (returning None instead
of the expected empty string) the first time a non-Text node is met.
Incidentally, DOM Level 3 Core defines the property 'textContent' to
return pretty much exactly this (although it removes the ignorable
whitespace). Not in minidom yet, but... <insert usual plug here>
--
Andrew Clover
private.php?do=newpm&u=
http://www.doxdesk.com/