diff -r c0b391a18df3 genshi/template/tests/directives.py
--- a/genshi/template/tests/directives.py	Fri Apr 16 09:30:53 2010 +0200
+++ b/genshi/template/tests/directives.py	Fri Apr 16 10:22:55 2010 +0200
@@ -1004,6 +1004,29 @@
           <body>
           </body>
         </html>""", tmpl.generate().render())
+    
+    def test_triple_match_with_more_complicated_path_still_matches(self):
+        tmpl = MarkupTemplate("""
+            <html xmlns="http://www.w3.org/1999/xhtml" 
+                  xmlns:py="http://genshi.edgewall.org/">
+                
+                <py:match path="div//*[@id='fnord']" buffer="false">FOO</py:match>
+                
+                <py:match path="body" buffer="false">
+                    <body>${select('*|text()')}</body>
+                </py:match>
+                
+                <py:match path="body" buffer="false">
+                    <body>${select('*|text()')}</body>
+                </py:match>
+                
+                <body>
+                    <div id="fnord" />
+                </body>
+            </html>
+        """)
+        html = tmpl.generate().render('xhtml', doctype='xhtml')
+        self.assertTrue('FOO' in html, html)
 
     # FIXME
     #def test_match_after_step(self):

