Commit cd1d5ddc authored by Nicolas Delaby's avatar Nicolas Delaby

small optimisation

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@25068 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ec355895
...@@ -154,13 +154,12 @@ class OOoBuilder(Implicit): ...@@ -154,13 +154,12 @@ class OOoBuilder(Implicit):
from lxml import etree from lxml import etree
from lxml.etree import Element from lxml.etree import Element
from copy import deepcopy from copy import deepcopy
if xsl_content is None: content_doc = etree.XML(content_xml)
raise ImportError if xsl_content is not None:
stylesheet_doc = etree.XML(xsl_content) stylesheet_doc = etree.XML(xsl_content)
stylesheet = etree.XSLT(stylesheet_doc) stylesheet = etree.XSLT(stylesheet_doc)
content_doc = etree.XML(content_xml) content_doc = stylesheet(content_doc)
result_doc = stylesheet(content_doc) root = content_doc.getroot()
root = result_doc.getroot()
#Declare zope namespaces #Declare zope namespaces
NSMAP = {'tal': 'http://xml.zope.org/namespaces/tal', NSMAP = {'tal': 'http://xml.zope.org/namespaces/tal',
'i18n': 'http://xml.zope.org/namespaces/i18n', 'i18n': 'http://xml.zope.org/namespaces/i18n',
......
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