Commit 75f32e5f authored by Fabien Morin's avatar Fabien Morin

- add a code part to replace caracters from scribus file (.sla) wich are not

  xml valid and make xml parser failed to parse it. They appear for example 
  when you have more than one line in a text frame or if you have tabulation 
  caracter.
  This hack is temporary, because the problem comes with scribus and perhaps
  will be corrected in the next scribus version.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@18924 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 2071ee26
......@@ -1235,10 +1235,9 @@ class ScribusParser:
This function is used to get attributes'values in an object_dict and
to be sure a compatible value is returned (for that use default value)
"""
#return object_dict.get(check_key, None) or default_value
if object_dict.has_key(check_key):
# 'check_key' exists
if len(object_dict[check_key]) != 0:
if len(object_dict[check_key]):
# check_key corresponding value is not null
# returning this value
return object_dict[check_key]
......@@ -1261,6 +1260,15 @@ class ScribusParser:
containing a dict of all the relative attributes
"""
# XXX this is a hack to correct a scribus problem
# actualy scribus (version 1.3.3.12svn) use some invali xml caracters
# like the '' caracter wich is a carriage return caratere, used for
# example in a text frame with many lines
# this problem is well knowed by scribus community and perhaps will be
# correct in futur scribus version
xml_string = xml_string.replace('', '\n')
xml_string = xml_string.replace('', '\t')
# Create DOM tree from the xml string
print " > create DOM tree"
dom_tree = minidom.parseString(xml_string)
......@@ -1351,7 +1359,7 @@ class ScribusParser:
# end parsing document version 1.2.*
else:
print " found Scribus Doucment format 1.3"
print " found Scribus Doucment format 1.3 or higher"
# assuming version is compliant with 1.3.* specifications
keep_page = 1
......
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