Commit 3000518e authored by Mayoro Diagne's avatar Mayoro Diagne

store parsed xml tree to avoid multiple tree creation to accelarate parsing

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@36619 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 8d4522e7
...@@ -55,9 +55,8 @@ class ScribusParser: ...@@ -55,9 +55,8 @@ class ScribusParser:
source = open(scribus_file_descriptor, "rb") source = open(scribus_file_descriptor, "rb")
data = source.read() data = source.read()
source.close() source.close()
data = data.replace('', '\n')
data = data.replace('', '\t') self.parsed_data = etree.XML(data)
self.data = data
def getData(self): def getData(self):
""" """
...@@ -69,7 +68,7 @@ class ScribusParser: ...@@ -69,7 +68,7 @@ class ScribusParser:
""" """
Return the content file in XML structured Return the content file in XML structured
""" """
return etree.XML(self.getData()) return self.parsed_data
def getXMLObjectByTagName(self, tag_name): def getXMLObjectByTagName(self, tag_name):
......
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