Edgewall Software

Ticket #107 (closed defect: fixed)

Opened 5 years ago

Last modified 5 years ago

namespace trouble with py:if

Reported by: dag@… Owned by: cmlenz
Priority: major Milestone: 0.4
Component: Template processing Version: devel
Keywords: Cc:

Description

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

Attachments

Change History

Changed 5 years ago by cmlenz

  • status changed from new to closed
  • resolution set to fixed

Thanks for the report. Should be fixed in [529].

Add/Change #107 (namespace trouble with py:if)

Author


E-mail address and user name can be saved in the Preferences.


Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
 
Note: See TracTickets for help on using tickets.