Index: /trunk/genshi/path.py
===================================================================
--- /trunk/genshi/path.py	(revision 1268)
+++ /trunk/genshi/path.py	(revision 1269)
@@ -1009,5 +1009,5 @@
         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
Index: /trunk/genshi/tests/path.py
===================================================================
--- /trunk/genshi/tests/path.py	(revision 1268)
+++ /trunk/genshi/tests/path.py	(revision 1269)
@@ -15,4 +15,5 @@
 import unittest
 
+from genshi.core import Attrs, QName
 from genshi.input import XML
 from genshi.path import Path, PathParser, PathSyntaxError, GenericStrategy, \
@@ -631,4 +632,23 @@
                               output='')
 
+    def test_attr_selection(self):
+        xml = XML('<root><foo bar="abc"></foo></root>')
+        path = Path('foo/@bar')
+        result = path.select(xml)
+        self.assertEqual(list(result), [
+            Attrs([(QName('bar'), u'abc')])
+        ])
+
+    def test_attr_selection_with_namespace(self):
+        xml = XML(
+            '<root xmlns:ns1="http://example.com">'
+            '<foo ns1:bar="abc"></foo>'
+            '</root>')
+        path = Path('foo/@ns1:bar')
+        result = path.select(xml, namespaces={'ns1': 'http://example.com'})
+        self.assertEqual(list(result), [
+            Attrs([(QName('http://example.com}bar'), u'abc')])
+        ])
+
     def _test_support(self, strategy_class, text):
         path = PathParser(text, None, -1).parse()[0]
