Now secretary can render headers.
This commit is contained in:
parent
08bb72ed31
commit
6bcced99cd
1 changed files with 4 additions and 2 deletions
|
|
@ -60,7 +60,9 @@ class BaseRender():
|
|||
def __init__(self, xml_doc, template_args):
|
||||
self.template_vars = template_args
|
||||
self.xml_document = xml.dom.minidom.parseString(xml_doc)
|
||||
body = self.xml_document.getElementsByTagName('office:body')
|
||||
body = self.xml_document.getElementsByTagName('office:body') or \
|
||||
self.xml_document.getElementsByTagName('office:master-styles')
|
||||
|
||||
self.content_body = body and body[0]
|
||||
|
||||
# ------------------------------------------------------------------------@
|
||||
|
|
@ -188,7 +190,7 @@ def render_template(template, **kwargs):
|
|||
for zi in input.filelist:
|
||||
out = input.read( zi.filename )
|
||||
|
||||
if zi.filename == 'content.xml':
|
||||
if zi.filename in ('content.xml', 'styles.xml'):
|
||||
render = BaseRender(out, kwargs)
|
||||
out = render.render().encode('ascii', 'xmlcharrefreplace')
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue