Commit 7337014e authored by Nicolas Delaby's avatar Nicolas Delaby

use getparent method provide by lxml (not ElementTree)

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@25064 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 13b7cbb7
......@@ -79,7 +79,7 @@ class OOOdCommandTransform(commandtransform):
XLINK_NAMESPACE = 'http://www.w3.org/1999/xlink'
ratio_px_cm = 2.54 / 100.
for image_tag in image_tag_list:
frame = image_tag.xpath('parent::node()')[0]
frame = image_tag.getparent()
#Try to get image file from ZODB
href_attribute_list = image_tag.xpath('.//@*[name() = "xlink:href"]')
url = href_attribute_list[0]
......@@ -150,7 +150,7 @@ class OOOdCommandTransform(commandtransform):
else:
#Other cases like files
css_as_text = str(css_object)
parent_node = css_link_tag.xpath('parent::node()')[0]
parent_node = css_link_tag.getparent()
style_node = Element('style')
style_node.text = css_as_text
parent_node.append(style_node)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment