Project

General

Profile

« Previous | Next » 

Revision 4038

xml_dom.py: is_empty(): Treat whitespace-only text nodes (including text nodes containing empty strings) as empty. This will also support None equivalents in text nodes, because they are isspace_none_str, which is considered whitespace.

View differences:

lib/xml_dom.py
82 82

  
83 83
def is_empty(node):
84 84
    for child in NodeIter(node):
85
        if not is_comment(child): return False
85
        if not (is_whitespace(child) or is_comment(child)): return False
86 86
    return True
87 87

  
88 88
def clean_comment(str_):

Also available in: Unified diff