+
+ def validate(self):
+ from librarian.elements.masters import Master
+ from librarian.elements.blocks import DlugiCytat, PoezjaCyt
+ from librarian.elements.footnotes import Footnote
+
+ if self.SECTION_PRECEDENCE:
+ assert isinstance(self.getparent(), (Master, DlugiCytat, PoezjaCyt, Footnote)), \
+ 'Header {} inside a <{}> instead of a master.'.format(
+ etree.tostring(self, encoding='unicode'), self.getparent().tag)
+
+ for c in self:
+ if isinstance(c, WLElement):
+ c.validate()
+
+