I use hpricot for all my XML - to access a node in a doc via XPath, you just do:
node = (doc / "/path/to/node")
The / operator is overloaded to do XPath. Check out the docs first (use google) for the exact syntax. You must explicitly tell hpricot you are parsing xml or it will not work right.
Jamie McLaughlin
SAIC
Office: 703-292-6307
Mobile: 571-263-2528
···
----- Original Message -----
From: martin@angleritech.com <martin@angleritech.com>
To: ruby-talk ML <ruby-talk@ruby-lang.org>
Sent: Mon May 19 06:40:32 2008
Subject: using Xpath in Ruby
Dear friends,
I want use xpath in my ruby program. could you please suggest some ways
to proceed .?. Some links would help me to do..
I need some some details regarding how its implemented in REXML and
HPRICOT.
Thanks in advance..
Regards,
Jose
--
Posted via http://www.ruby-forum.com/.