+def fix_empty_opis(book, author, dry_run=True):
+ fc = book[0]
+ txt = fc.materialize()
+ try:
+ t = etree.fromstring(txt)
+ empty_opis = t.xpath('//opis[not(node())]')
+ empty_cwiczenie = t.xpath('//cwiczenie[not(node())]')
+
+ if empty_opis:
+ print "%s: opis/ x %d" % (book.slug, len(empty_opis))
+
+ if empty_cwiczenie:
+ print "%s: cwiczenie/ x %d" % (book.slug, len(empty_cwiczenie))
+
+ except:
+ print "%s didn't parse" % b.slug
+ return
+
+