def render(self, template, data): """ Return the X(HT)ML from based on the base template, with the given template parameter as the child template, and the data parameter passed to the templates. """ if self.base_template: doc = xmltemplate.process_file(os.path.join(self.template_dir, template), data, False) data[self.inclusion_param] = doc master = xmltemplate.process_file(os.path.join(self.template_dir, self.base_template), data) else: master = xmltemplate.process_file(os.path.join(self.template_dir, template), data) return master.toxml()
def render(self, template, data): """ """ if self.base_template: doc = xmltemplate.process_file( os.path.join(self.template_dir, template), data, False) data[self.inclusion_param] = doc master = xmltemplate.process_file( os.path.join(self.template_dir, self.base_template), data); else: master = xmltemplate.process_file( os.path.join(self.template_dir, template), data) return master.toxml().encode("utf-8")
def render(self, template, data): """ Return the X(HT)ML from based on the base template, with the given template parameter as the child template, and the data parameter passed to the templates. """ if self.base_template: doc = xmltemplate.process_file( os.path.join(self.template_dir, template), data, False) data[self.inclusion_param] = doc master = xmltemplate.process_file( os.path.join(self.template_dir, self.base_template), data); else: master = xmltemplate.process_file( os.path.join(self.template_dir, template), data) return master.toxml().encode("utf-8")