From 11d863057b43462248572daed7c8fc698d573b3d Mon Sep 17 00:00:00 2001 From: Marcin Koziej Date: Mon, 4 Feb 2013 15:27:42 +0100 Subject: [PATCH] pulling dictionary --- librarian/pyhtml.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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) -- 2.20.1