Topic: How to search xml tag using hpricot

Hi.. Everyone..

Please could anyone assist me that how to search any xml tag using hpricot gem

and if searched item is found in xml file , i need result in true or false.


that is ...

my xml 
<root>
      <products type="array">
         <product>
            <analyst_comments>hi</analyst_comments>
            <prd_name>pen</prd_name>
            <pid>5434132</pid>
            <ttype nil="true"></ttype>
            <enddate type="date">2009-07-31</enddate>
         </product>
      </products>
</root>

I want to search  whether  there exists any <products> and </products> tags in above  "my xml" or not..


Thanks smile

Last edited by cyberyogi (2011-09-21 08:15:51)

Re: How to search xml tag using hpricot

Hi.. Community smile

If anybody have any another way that is doing the same thing I described above  without using hpricot gem .
Please feel free to share and guide smile


Thanks smile

Last edited by cyberyogi (2011-09-21 09:36:24)