opental-checkins
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[OpenTAL-checkins] opental/pax paxtransform.py utils.py


From: Fernando Lalo Martins
Subject: [OpenTAL-checkins] opental/pax paxtransform.py utils.py
Date: Mon, 27 Jan 2003 02:10:54 -0500

CVSROOT:        /cvsroot/opental
Module name:    opental
Changes by:     Fernando Lalo Martins <address@hidden>  03/01/27 02:10:54

Modified files:
        pax            : paxtransform.py utils.py 

Log message:
        adding an engine that renders stuff to XML after postprocess; it turns 
out 80% of transform uses want to do that, and doing it now saves one recursive 
loop (therefore speeding things up a bit)

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/opental/opental/pax/paxtransform.py.diff?tr1=1.22&tr2=1.23&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/opental/opental/pax/utils.py.diff?tr1=1.8&tr2=1.9&r1=text&r2=text

Patches:
Index: opental/pax/paxtransform.py
diff -u opental/pax/paxtransform.py:1.22 opental/pax/paxtransform.py:1.23
--- opental/pax/paxtransform.py:1.22    Wed Sep 11 20:00:57 2002
+++ opental/pax/paxtransform.py Mon Jan 27 02:10:54 2003
@@ -3,7 +3,8 @@
 # this file is placed on public domain
 
 from backwards_compatibility import *
-from utils import pack_list
+from utils import pack_list, XML
+from core import Literal
 import types
 
 class StopTransform(Exception):
@@ -104,6 +105,12 @@
             if not callable(pp): continue
             element = pp(element, context)
         return element
+
+class RenderingEngine(Engine):
+    "Transforms something, and renders it to XML"
+    def postprocess(self, element, context):
+        element = Engine.postprocess(self, element, context)
+        return Literal(XML(element, context.root_xmlns_map, context.encoding))
 
 
 class AttributeHandler(object):
Index: opental/pax/utils.py
diff -u opental/pax/utils.py:1.8 opental/pax/utils.py:1.9
--- opental/pax/utils.py:1.8    Wed Sep 11 20:00:57 2002
+++ opental/pax/utils.py        Mon Jan 27 02:10:54 2003
@@ -2,6 +2,7 @@
 # developed by Lalo Martins <address@hidden>
 # this file is placed on public domain
 
+from backwards_compatibility import *
 from xml.sax.saxutils import escape
 import sys, types
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]