Hello,

David Alan Black <dblack / candle.superlink.net> wrote:
> which I don't think would make for any easier XPath manipulation than:
> 
>   <class name="A">
>     <class name="A">
>     </class>
>   </class>

--tmp.xml-----------------------------------
<class name="A">
  <description>comment of A</description>
  <class name="B">
     <description>comment of B</description>
  </class>
</class>
--------------------------------------------

---parse.rb---------------------------------
require 'rexml/document'

doc = REXML::Document.new(File.new("tmp.xml"))
puts doc.elements["/class[@name='A']/description"]
puts doc.elements["/class[@name='A']/class[@name='B']/description"]
--------------------------------------------

Then,

 % ruby parse.rb
 <description>comment of A</description>
 <description>comment of B</description>


Is it easy?


Regards,

TAKAHASHI 'Maki' Masayoshi (yet another XPath newbie)