Re: using Xpath in Ruby

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: [email protected] removed_e[email protected]
To: ruby-talk ML [email protected]
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/.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs