Ejemplo n.º 1
0
 def renderxml(obj):
     context = TALContext(allowPythonPath=1)
     context.addGlobal('here', obj)
     context.addGlobal('self', obj)
     context.addGlobal('container', obj.parentNode)
     context.addGlobal('config', obj.ownerDocument.config)
     context.addGlobal('context', obj.ownerDocument.context)
     context.addGlobal('template', template)
     context.addGlobal('templates', obj.renderer)
     output = StringIO()
     template.expand(context, output, encoding, docType=None, suppressXMLDeclaration=1)
     return unicode(output.getvalue(), encoding)
Ejemplo n.º 2
0
 def renderxml(obj):
     context = TALContext(allowPythonPath=1)
     context.addGlobal('here', obj)
     context.addGlobal('self', obj)
     context.addGlobal('container', obj.parentNode)
     context.addGlobal('config', obj.ownerDocument.config)
     context.addGlobal('context', obj.ownerDocument.context)
     context.addGlobal('template', template)
     context.addGlobal('templates', obj.renderer)
     output = StringIO()
     template.expand(context, output, encoding, docType=None, suppressXMLDeclaration=1)
     return unicode(output.getvalue(), encoding)
Ejemplo n.º 3
0
 def renderhtml(obj):
     context = TALContext(allowPythonPath=1)
     context.addGlobal("here", obj)
     context.addGlobal("self", obj)
     context.addGlobal("container", obj.parentNode)
     context.addGlobal("config", obj.ownerDocument.config)
     context.addGlobal("context", obj.ownerDocument.context)
     context.addGlobal("template", template)
     context.addGlobal("templates", obj.renderer)
     output = StringIO()
     template.expand(context, output, encoding)
     return unicode(output.getvalue(), encoding)