[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

NWS-NOAA: accessing attributes with SOAP4R

Tom Verbeure

2/17/2006 8:12:00 AM

Hi Ruby Guru's,

I've successfully retrieved data from the NWS weather server with the
example that was give at the following link:
http://groups.google.com/group/comp.lang.ruby/msg/5fb9a1...

So far so good.

However, I'm only able to get text data, that is the data that's not
part of an XML tag. I did not find a way to access XML attributes.

E.g.: I have no problem to get the 'point1' information, indicated by
<location-key>, but I can find a way to get '

<location>
<location-key>point1</location-key>
<point latitude="38.99" longitude="-77.99" />
</location>
<time-layout time-coordinate="local" summarization="none">
<layout-key>k-p24h-n7-1</layout-key>

The closest I've gotten to see that the data is actually there is by
doing:

p data['location']['point'].__xmlattr

This prints something that lists 'latitude' and 'longitude'. But how do
I access the value itself?

p data['location']['point'].__xmlattr['latitude'] or
p data['location']['point'].latitude

doesn't work.

Any suggestions are greatly appreciated!

Tom

4 Answers

Holgi

2/17/2006 8:37:00 AM

0

Hey,

Well, I'm not an expert (yet:) in Ruby, but I stumbled across the
"extraattr"-attribute of the SOAPElement in the SOAP4R-library.

See http://www.ruby-doc.org/stdlib/libdoc/soap/rdoc/... and
http://wiki.rubyonrails.com/rails/pages/PayPalW... for more
details.

Maybe that'll help you?

Holgi

Tom Verbeure

2/17/2006 10:58:00 PM

0

Hi Holgi,

Thanks for the pointers. Unfortunately, it seems that I'm dealing with
a SOAP::Mapping:Object instead of a SOAPElement. I'll let you know if I
make any progress.

Tom

LookingGlass

4/29/2010 4:50:00 PM

0

On Apr 29, 3:57 am, Dale Houstman <d...@skypoint.com> wrote:
> The Nice Mean Man wrote:
>
> > On Apr 28, 11:56 pm, LookingGlass <goldencocke...@gmail.com> wrote:
> >> The discovery of water brought a tear to my eye. It was expected, but
> >> the *confirmation* is astonishing.
>
> >> Whooppee...!!!http://tinyurl.c...
>
> >>www.Shemakhan.com
>
> > Why is it "astonishing"? Is your head so far up your own asshole that
> > you think earth is the only place in the universe that has it? Why
> > would you think that? Why would we be so-blessed and no other place?
> > Nowhere?
> > Your kind of thinking is the kind that held that the earth was the
> > center of the universe... And apparently to you, it still is....
>
> And your reaction to a simple and sincere expression of cosmic joy over
> discovery is - to put it mildly - ugly and inhuman.
>
> You can be quite aware that a substance (such as water) exists in
> plenitude throughout the universe (as I am sure "LooingGlass" was) and
> still be moved at the discovery of this substance in any particular
> spot. For instance: if you were lost in the Sahara, dehydrating at an
> astonishing pace, your knowledge that the Earth is at least 75% water
> would hardly stop you from being joyful when you rounded a dune and
> discovered a small pool of fresh water only a few feet from you.
>
> And - on a simpler plane - your response is illogical: since
> LookingGlass said the discovery of water was expected, he could hardly
> be one of those imaginary people you created who thinks Earth is the
> only place that has water.
>
> So - from every possible angle - your comments are ugly and stupid. Am I
> astonished that your comments are ugly and stupid? Hardly...
>
> dmh


Quoted from article...

Furthermore, scientists didn't just find ice; they found organic
molecules, similar to what may have started life on Earth, Campins
said.

"This asteroid holds clues to our past and how the solar system and
water on Earth may have originated and it also has clues to our future
with exploration of near-Earth asteroids," Campins told The Associated
Press.

"We're showing that they're wetter than we thought," Campins said.
"We're showing they have organic molecules that might have been the
building blocks of life on Earth."

....all reasons to be excited. How rapidly we have come to know and
begin to understand the granduer of the *cosmic* blueprint. Now if we
could just fire up the LHC and get some results...though I can do
without an earth-centric black hole. That sucks!

"To infinity, and beyond!" - Buzz Lightyear


www.Shemakhan.com

Dale Houstman

4/30/2010 5:56:00 AM

0

LookingGlass wrote:
> On Apr 29, 3:57 am, Dale Houstman <d...@skypoint.com> wrote:
>> The Nice Mean Man wrote:
>>
>>> On Apr 28, 11:56 pm, LookingGlass <goldencocke...@gmail.com> wrote:
>>>> The discovery of water brought a tear to my eye. It was expected, but
>>>> the *confirmation* is astonishing.
>>>> Whooppee...!!!http://tinyurl.c...
>>>> www.Shemakhan.com
>>> Why is it "astonishing"? Is your head so far up your own asshole that
>>> you think earth is the only place in the universe that has it? Why
>>> would you think that? Why would we be so-blessed and no other place?
>>> Nowhere?
>>> Your kind of thinking is the kind that held that the earth was the
>>> center of the universe... And apparently to you, it still is....
>> And your reaction to a simple and sincere expression of cosmic joy over
>> discovery is - to put it mildly - ugly and inhuman.
>>
>> You can be quite aware that a substance (such as water) exists in
>> plenitude throughout the universe (as I am sure "LooingGlass" was) and
>> still be moved at the discovery of this substance in any particular
>> spot. For instance: if you were lost in the Sahara, dehydrating at an
>> astonishing pace, your knowledge that the Earth is at least 75% water
>> would hardly stop you from being joyful when you rounded a dune and
>> discovered a small pool of fresh water only a few feet from you.
>>
>> And - on a simpler plane - your response is illogical: since
>> LookingGlass said the discovery of water was expected, he could hardly
>> be one of those imaginary people you created who thinks Earth is the
>> only place that has water.
>>
>> So - from every possible angle - your comments are ugly and stupid. Am I
>> astonished that your comments are ugly and stupid? Hardly...
>>
>> dmh
>
>
> Quoted from article...
>
> Furthermore, scientists didn't just find ice; they found organic
> molecules, similar to what may have started life on Earth, Campins
> said.
>
> "This asteroid holds clues to our past and how the solar system and
> water on Earth may have originated and it also has clues to our future
> with exploration of near-Earth asteroids," Campins told The Associated
> Press.
>
> "We're showing that they're wetter than we thought," Campins said.
> "We're showing they have organic molecules that might have been the
> building blocks of life on Earth."
>
> ...all reasons to be excited. How rapidly we have come to know and
> begin to understand the granduer of the *cosmic* blueprint. Now if we
> could just fire up the LHC and get some results...though I can do
> without an earth-centric black hole. That sucks!
>
> "To infinity, and beyond!" - Buzz Lightyear
>
>
I doubt the existence of Earth's personal black hole, but I do think
there might be one at the center of "The Nice Mean Man" - well, at least
an off-white hole...

dmh