﻿id,summary,reporter,owner,description,type,status,priority,milestone,component,version,resolution,keywords,cc
107,namespace trouble with py:if,dag@…,cmlenz,"The following code produces incorrect output when rendered by Genshi.

{{{
from genshi.template import MarkupTemplate
from genshi import *

tmpl = """"""<?xml version=""1.0""?>
<Test xmlns:py=""http://genshi.edgewall.org/"">
<Size py:if=""0"" xmlns=""test"">Size</Size>
<Item/>
</Test>""""""

t = MarkupTemplate(tmpl)
s = t.generate()
print s.render()
}}}

The incorrect output is:

{{{
<Test>

<Item xmlns=""test""/>
</Test>
}}}

Notice how the namespace declaration has moved from the Size element into the Item element. Looks like Genshi somehow has forgot to remove the namespace declaration when the element is removed by py:if being False. Other attributes are handled correctly. This is only a problem with namespace declarations.

The correct output (as produced by Kid) should be:

{{{
<Test>

<Item/>
</Test>
}}}

-- Dag",defect,closed,major,0.4,Template processing,devel,fixed,,
