document = WLDocument.from_string(input, True, \
parse_dublincore=parse_dublincore)
+ document.clean_ed_note()
+
result = document.transform(style, **options)
del document # no longer needed large object :)
except Exception, e:
unmerged.append( repr( (key, xpath, e) ) )
- return unmerged
\ No newline at end of file
+ return unmerged
+
+ def clean_ed_note(self):
+ """ deletes forbidden tags from nota_red """
+
+ for node in self.edoc.xpath('|'.join('//nota_red//%s' % tag for tag in
+ ('pa', 'pe', 'pr', 'pt', 'begin', 'end', 'motyw'))):
+ tail = node.tail
+ node.clear()
+ node.tag = 'span'
+ node.tail = tail