Edgewall Software

Opened 18 years ago

Closed 18 years ago

Last modified 13 years ago

#105 closed defect (fixed)

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:

Description

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 (2)

comment:1 Changed 18 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:

comment:2 Changed 18 years ago by cmlenz

  • Resolution set to fixed
  • Status changed from new to closed

Patch applied in [511].

Note: See TracTickets for help on using tickets.