Edgewall Software

Ticket #243 (closed defect: fixed)

Opened 4 years ago

Last modified 4 years ago

Invalid XML when buffer="false" in py:match

Reported by: felix.schwarz@… Owned by: cmlenz
Priority: critical Milestone: 0.5.1
Component: Template processing Version: 0.5
Keywords: Cc:

Description

When switching from Genshi 0.4.4 to 0.5 I noticed that Genshi generates invalid XML in some situations when buffer is set to False in py:match.

An example for invalid XML generated by Genshi (note the duplicated closing body tag):

<html xmlns="http://www.w3.org/1999/xhtml">
    <body>
        <div id="banner">
            This is the original text in ticket
        </div>
    </body>
  </body>
</html>

Attachments

test_invalid_xml.py Download (0.8 KB) - added by felix.schwarz@… 4 years ago.
Testcase which demonstrates the behavior (works with Genshi 0.4.4)
ticket243.diff Download (2.7 KB) - added by cmlenz 4 years ago.
Patch that should address the issue, but not tested much

Change History

Changed 4 years ago by felix.schwarz@…

Testcase which demonstrates the behavior (works with Genshi 0.4.4)

Changed 4 years ago by cmlenz

  • status changed from new to assigned
  • component changed from General to Template processing

Ouch. This seems to be caused by a match template not including the match content, i.e. no select() calls.

Changed 4 years ago by cmlenz

Patch that should address the issue, but not tested much

Changed 4 years ago by cmlenz

I've attached a patch to this ticket that should fix the trailing close tag.

Changed 4 years ago by cmlenz

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

After more testing, checked in in [897]. Additional verification would be appreciated.

Thanks for reporting this problem!

Changed 4 years ago by cmlenz

And ported to 0.5.x for 0.5.1 in [898].

Add/Change #243 (Invalid XML when buffer="false" in py:match)

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.