# Problum in parsing xml

**URL:** <https://www.ruby-forum.com/t/problum-in-parsing-xml/179453>\
**Category:** Rails\
**Created:** [November 25, 2009, 10:00am UTC](https://www.ruby-forum.com/t/problum-in-parsing-xml/179453 "2009-11-25T10:00:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![chinna\_gogulapati](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f9ae1b/32.png) [@chinna\_gogulapati](https://www.ruby-forum.com/u/chinna_gogulapati)\
**Post date:** [November 25, 2009, 10:00am UTC](https://www.ruby-forum.com/t/problum-in-parsing-xml/179453/1 "2009-11-25T10:00:03Z")

</div>

Hi All

Can any one suggest me the wrong in the bellow code  
\<%  
require ‘rubygems’  
require ‘hpricot’

doch = Hpricot(@resp\_data.receive\_string)  
doch.search(‘Record’).each do |rec|  
rec.search(“Property”).each do |prop|  
puts prop.attributes[‘Key’]  
end  
end  
%\>

Where @resp\_data is the following xml.

\<soap:Envelope xmlns:soap=“[http://schemas.xmlsoap.org/soap/envelope/](http://schemas.xmlsoap.org/soap/envelope/)”\>  
soap:Body  
  
  
  
  
  
Gadgets  
…  
  
  
  
  
  
\</soap:Body\>  
\</soap:Envelope\>

Thanks in advance  
Chinna

---

<div class="post-metadata">

**Author:** ![chinna\_gogulapati](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f9ae1b/32.png) [@chinna\_gogulapati](https://www.ruby-forum.com/u/chinna_gogulapati)\
**Post date:** [November 25, 2009, 9:02pm UTC](https://www.ruby-forum.com/t/problum-in-parsing-xml/179453/2 "2009-11-25T21:02:21Z")

</div>

Hi, what is your problem?

I run your code and got P\_Interest back…

Cheers.

---

<div class="post-metadata">

**Author:** ![chinna\_gogulapati](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f9ae1b/32.png) [@chinna\_gogulapati](https://www.ruby-forum.com/u/chinna_gogulapati)\
**Post date:** [November 26, 2009, 10:52am UTC](https://www.ruby-forum.com/t/problum-in-parsing-xml/179453/3 "2009-11-26T10:52:09Z")

</div>

comopasta Gr wrote:

> Hi, what is your problem?
> 
> I run your code and got P\_Interest back…
> 
> Cheers.

Hi Comopasta,

Thanks for replay. I got solution, Actually my XML is the out put of web  
service. The problem is, i got each Element name in the XML as small  
case even those are in cap’s in web service response like to  
, i was trying to get in my ruby program, so that is  
the problem.

Thanks  
Chinna
