[Checkins] SVN: Sandbox/malthe/chameleon.core/src/chameleon/core/translation.py Use tree-parser to avoid losing root reference.

Malthe Borch mborch at gmail.com
Tue Dec 2 11:51:36 EST 2008


Log message for revision 93547:
  Use tree-parser to avoid losing root reference.

Changed:
  U   Sandbox/malthe/chameleon.core/src/chameleon/core/translation.py

-=-
Modified: Sandbox/malthe/chameleon.core/src/chameleon/core/translation.py
===================================================================
--- Sandbox/malthe/chameleon.core/src/chameleon/core/translation.py	2008-12-02 15:36:10 UTC (rev 93546)
+++ Sandbox/malthe/chameleon.core/src/chameleon/core/translation.py	2008-12-02 16:51:36 UTC (rev 93547)
@@ -721,10 +721,12 @@
 
         if macro is not None:
             if macro == "" and 'xmlns' in root.attrib:
-                del root.attrib['xmlns']        
-            wrap = root.makeelement(utils.meta_attr('wrap'))
-            wrap.append(root)
-            root = wrap        
+                del root.attrib['xmlns']
+
+            wrapper = self.tree.parser.makeelement(
+                utils.meta_attr('wrapper'), root.attrib)
+            wrapper.append(root)
+            root = wrapper
             
         # output XML headers, if applicable
         if not macro:



More information about the Checkins mailing list