Edgewall Software

Ticket #105 (closed defect: fixed)

Opened 8 years ago

Last modified 4 years ago

ET does not convert attribute names to QName.

Reported by: Maciej Ligenza Owned by: cmlenz
Priority: major Milestone: 0.4
Component: Template processing Version: 0.3.6
Keywords: Cc:


ET helper does not prepare attributes properly. The attributes are held in form Attrs( list_of( (string, string) ) ) instead of Attrs( list_of( (QName,string) ) ) (see: source:trunk/genshi/input.py@504#L33). In that form NamespaceFlattener.__call__() (and probably others) can't cope with them properly (see: source:trunk/genshi/output.py@504#L440).


Change History

Changed 8 years ago by Maciej Ligenza

Patch that helps:

$ LC_ALL=C svn diff
Index: genshi/input.py
--- genshi/input.py     (revision 505)
+++ genshi/input.py     (working copy)
@@ -30,7 +30,7 @@
 def ET(element):
     """Convert a given ElementTree element to a markup stream."""
     tag_name = QName(element.tag.lstrip('{'))
-    attrs = Attrs(element.items())
+    attrs = Attrs([(QName(attr), value) for attr, value in element.items()])

     yield START, (tag_name, attrs), (None, -1, -1)
     if element.text:

Changed 8 years ago by cmlenz

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

Patch applied in [511].

Add/Change #105 (ET does not convert attribute names to QName.)


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

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