Edgewall Software

Opened 11 years ago

Closed 11 years ago

Last modified 7 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:


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).

Attachments (0)

Change History (2)

comment:1 Changed 11 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 11 years ago by cmlenz

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

Patch applied in [511].

Add Comment

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain cmlenz.
The resolution will be deleted. Next status will be 'reopened'.

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

Note: See TracTickets for help on using tickets.