X-Git-Url: https://git.mdrn.pl/librarian.git/blobdiff_plain/b0224a1763fd71c1c9ed19e7663d94106a513dc8..476f5bc05232372880327aa62b3ea8c9f7dea13b:/librarian/pyhtml.py diff --git a/librarian/pyhtml.py b/librarian/pyhtml.py index 88e1194..f358178 100644 --- a/librarian/pyhtml.py +++ b/librarian/pyhtml.py @@ -113,7 +113,7 @@ class EduModule(Xmill): surl = element.attrib.get('href', None) sxml = None if surl: - sxml = etree.fromstring(self.provider.by_uri(surl).get_string()) + sxml = etree.fromstring(self.options['provider'].by_uri(surl).get_string()) self.options = {'slowniczek': True, 'slowniczek_xml': sxml } return '
', '
' @@ -143,9 +143,10 @@ class EduModule(Xmill): # let's pull definiens from another document if self.options['slowniczek_xml'] and (not nxt or nxt.tag != 'definiens'): sxml = self.options['slowniczek_xml'] - defloc = sxml.xpath("//definiendum[content()='%s']" % element.text) + assert element.text != '' + defloc = sxml.xpath("//definiendum[text()='%s']" % element.text) if defloc: - definiens = defloc.getnext() + definiens = defloc[0].getnext() if definiens.tag == 'definiens': subgen = EduModule(self.options) definiens_s = subgen.generate(definiens)