Hi All,

With the reference implementation of genshi you can do the following:
>>> from genshi.template import MarkupTemplate
>>> tmp = MarkupTemplate("""\
... <div xmlns="http://www.w3.org/1999/xhtml";
...      xmlns:py="http://genshi.edgewall.org/";>
...   <py:choose test="">
...     <span py:when="0 == 1">0</span>
...     <span py:when="1 == 1">1</span>
...   </py:choose>
... </div>""")
>>> stream = tmp.generate()
>>> print stream.render('xhtml')
<div xmlns="http://www.w3.org/1999/xhtml";>
    <span>1</span>
</div>

The same doesn't work in chameleon.genshi.

The attached patch adds a failing test that demonstrates this.

What tracker should I put this in?

cheers,

Chris

--
Simplistix - Content Management, Batch Processing & Python Consulting
           - http://www.simplistix.co.uk
Index: src/chameleon/genshi/language.txt
===================================================================
--- src/chameleon/genshi/language.txt   (revision 9494)
+++ src/chameleon/genshi/language.txt   (working copy)
@@ -113,6 +113,19 @@
     </div>
   </div>
 
+  >>> print render("""\
+  ... <div xmlns="http://www.w3.org/1999/xhtml";
+  ...      xmlns:py="http://genshi.edgewall.org/";>
+  ...   <py:choose test="">
+  ...     <span py:when="0 == 1">0</span>
+  ...     <span py:when="1 == 1">1</span>
+  ...   </py:choose>
+  ... </div>""")
+  <div xmlns="http://www.w3.org/1999/xhtml";>
+      <span>1</span>
+  </div>
+
+
 py:for
 
   >>> print render("""\
_______________________________________________
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev

Reply via email to