From: Gavin Kistner Date: 2005-09-04T14:51:33+09:00 Subject: REXML bug - descendant-or-self selector In XPath, "//" is an abbreviation for the "descendant-or-self" selector. My understanding (and Microsoft's XPath implementation) of this selector means that the following code should select the bar element as well as the descendants. [Sliver:~/Desktop] gkistner$ cat tmp.rb xml = < ENDXML require 'rexml/document' include REXML bar = XPath.first( Document.new( xml ), '//bar' ) bar.each_element( './/[@id]' ){ |element_with_id| puts element_with_id } [Sliver:~/Desktop] gkistner$ ruby -v tmp.rb ruby 1.8.2 (2004-12-25) [powerpc-darwin7.7.2]