Project

General

Profile

« Previous | Next » 

Revision 839

xml_dom.py: Fixed bug in NodeTextEntryIter where an entry containing an element instead of a text node would be returned as the whole entry, instead of the value of the entry

View differences:

lib/xml_dom.py
133 133
    def __iter__(self): return self
134 134
    
135 135
    def curr(self):
136
        child = self.iter_.curr()
137
        name = child.tagName
138
        if is_text(child): child = value(child)
139
        return (name, child)
136
        entry = self.iter_.curr()
137
        if is_text(entry): value_ = value(entry)
138
        else:
139
            assert has_one_child(entry) # TODO: convert to an exception
140
            value_ = entry.firstChild
141
        return (entry.tagName, value_)
140 142
    
141 143
    def next(self):
142 144
        entry = self.curr()

Also available in: Unified diff