X-Git-Url: https://git.mdrn.pl/librarian.git/blobdiff_plain/d9dc96ea261fdeed57bbb57c4405003893668d8d..a1e43b7bba2a0c7cf33280143bb49af3fef5d0d0:/librarian/xmlutils.py diff --git a/librarian/xmlutils.py b/librarian/xmlutils.py index d762320..37a719b 100644 --- a/librarian/xmlutils.py +++ b/librarian/xmlutils.py @@ -53,8 +53,6 @@ class Xmill(object): tagname = None # from nose.tools import set_trace - if isinstance(element, etree._Comment): return None - if element.tag[0] == '{': for nshort, nhref in element.nsmap.items(): try: @@ -89,6 +87,8 @@ class Xmill(object): if element is None: return None # end of tree def _handle_element(self, element): + if isinstance(element, etree._Comment): return None + handler = self._handle_for_element(element) # How many scopes try: @@ -96,13 +96,13 @@ class Xmill(object): if handler is None: pre = [self.filter_text(element.text)] - post = [] + post = [self.filter_text(element.tail)] else: vals = handler(element) # depending on number of returned values, vals can be None, a value, or a tuple. # how poorly designed is that? 9 lines below are needed just to unpack this. if vals is None: - return [] + return [self.filter_text(element.tail)] else: if not isinstance(vals, tuple): return [vals, self.filter_text(element.tail)]