diff genshi/path.py @ 1043:a21009a2bc3a trunk

Return correct value and properly namespaced attribute name when matching namespaced attributes with XPath expressions (fixes #572; thanks to Olemis Lang <olemis+trac@gmail.com> for bug report and suggestion for fix).
author hodgestar
date Thu, 20 Mar 2014 12:58:48 +0000
parents 16d55698006a
children
line wrap: on
line diff
--- a/genshi/path.py
+++ b/genshi/path.py
@@ -1008,7 +1008,7 @@
         qname = QName('%s}%s' % (namespaces.get(self.prefix), self.name))
         if kind is START:
             if self.principal_type is ATTRIBUTE and qname in data[1]:
-                return Attrs([(self.name, data[1].get(self.name))])
+                return Attrs([(qname, data[1].get(qname))])
             else:
                 return data[0] == qname
     def __repr__(self):
Copyright (C) 2012-2017 Edgewall Software