Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8034363
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T01:59:17+00:00 2026-06-05T01:59:17+00:00

I have some weather xml that I am trying to parse via php loop.

  • 0

I have some weather xml that I am trying to parse via php loop.
The problem is that I am able to access all nodes except

<aws:weather xmlns:aws="http://www.aws.com/aws>

I cannot drill down into this node. Is it because of the url?
I ultimatly need to access this node

<aws:station> Salinas Municipal Airport <aws:station>

This is the php that I have:

<?php
$html = "";
$url = "http://i.wxbug.net/REST/SP/" .
       "getLiveWeatherRSS.aspx?api_key=sdfgdsgd5454&stationid=SLNAS";
$xml = simplexml_load_file($url);
for ($i = 0; $i < 10; $i++) {
$aws:station = $xml->channel->aws:weather->aws:ob[$i]->aws:station;
$html .= "<h3>$aws:station</h3>"; 
}
echo $html;
?>

This is the xml

<rss xmlns:georss="http://www.georss.org/georss" version="2.0">
<channel>
<title>Observations from Salinas, CA - USA</title>
<link>...</link>
 <description>...</description>
<language>en-us</language>
<lastBuildDate>Tue, 29 May 2012 17:00:00 GMT</lastBuildDate>
<ttl>60</ttl>
 <aws:weather xmlns:aws="http://www.aws.com/aws">
<aws:api version="2.0"/>
<aws:WebURL>...</aws:WebURL>
<aws:InputLocationURL>...</aws:InputLocationURL>
<aws:ob>
<aws:ob-date>...</aws:ob-date>
<aws:requested-station-id>SLNAS</aws:requested-station-id>
<aws:station-id>KSNS</aws:station-id>
<aws:station>Salinas Municipal Airport</aws:station>
<aws:city-state zipcode="93905">Salinas, CA</aws:city-state>
<aws:country>USA</aws:country>
<aws:latitude>36.6633338928223</aws:latitude>
<aws:longitude>-121.608055114746</aws:longitude>
<aws:site-url/>
<aws:aux-temp units="&deg;F">0</aws:aux-temp>
<aws:aux-temp-rate units="&deg;F">-52.9</aws:aux-temp-rate>
<aws:current-condition icon="http://deskwx.weatherbug.com/images/Forecast/icons   
/cond000.gif">Clear</aws:current-condition>
<aws:dew-point units="&deg;F">45</aws:dew-point>
<aws:elevation units="ft">66</aws:elevation>
<aws:feels-like units="&deg;F"/>
<aws:gust-time>...</aws:gust-time>
<aws:gust-direction>WNW</aws:gust-direction>
<aws:gust-direction-degrees>281</aws:gust-direction-degrees>
<aws:gust-speed units="mph">N/A</aws:gust-speed>
<aws:humidity units="%">60</aws:humidity>
<aws:humidity-high units="%">6</aws:humidity-high>
<aws:humidity-low units="%">6</aws:humidity-low>
<aws:humidity-rate>0</aws:humidity-rate>
<aws:indoor-temp units="&deg;F">0</aws:indoor-temp>
<aws:indoor-temp-rate units="&deg;F">0</aws:indoor-temp-rate>
<aws:light>0</aws:light>
<aws:light-rate>0</aws:light-rate>
<aws:moon-phase moon-phase-img="http://api.wxbug.net/images/moonphase   
/mphase09.gif">-61</aws:moon-phase>
<aws:pressure units=""">30.08</aws:pressure>
<aws:pressure-high units=""">30.08</aws:pressure-high>
<aws:pressure-low units=""">30.05</aws:pressure-low>
<aws:pressure-rate units=""/h">0</aws:pressure-rate>
<aws:rain-month units=""">0</aws:rain-month>
<aws:rain-rate units=""/h">0</aws:rain-rate>
<aws:rain-rate-max units=""/h">0</aws:rain-rate-max>
<aws:rain-today units=""">0</aws:rain-today>
<aws:rain-year units=""">0</aws:rain-year>
<aws:temp units="&deg;F">59</aws:temp>
<aws:temp-high units="&deg;F">59</aws:temp-high>
<aws:temp-low units="&deg;F">51</aws:temp-low>
<aws:temp-rate units="&deg;F/h">0</aws:temp-rate>
<aws:sunrise>
<aws:year number="2012"/>
<aws:month number="5" text="May" abbrv="May"/>
<aws:day number="29" text="Tuesday" abbrv="Tue"/>
<aws:hour number="5" hour-24="05"/>
<aws:minute number="50"/>
<aws:second number="01"/>
<aws:am-pm abbrv="AM"/>
<aws:time-zone offset="-7" text="Pacific Daylight Time (USA)" abbrv="PDT"/>
</aws:sunrise>
<aws:sunset>
<aws:year number="2012"/>
<aws:month number="5" text="May" abbrv="May"/>
<aws:day number="29" text="Tuesday" abbrv="Tue"/>
<aws:hour number="8" hour-24="20"/>
<aws:minute number="18"/>
<aws:second number="10"/>
<aws:am-pm abbrv="PM"/>
<aws:time-zone offset="-7" text="Pacific Daylight Time (USA)" abbrv="PDT"/>
</aws:sunset>
<aws:wet-bulb units="&deg;F">51.602</aws:wet-bulb>
<aws:wind-speed units="mph">N/A</aws:wind-speed>
<aws:wind-speed-avg units="mph">N/A</aws:wind-speed-avg>
<aws:wind-direction>WNW</aws:wind-direction>
<aws:wind-direction-degrees>279</aws:wind-direction-degrees>
<aws:wind-direction-avg>WNW</aws:wind-direction-avg>
</aws:ob>
</aws:weather>
<image>...</image>
<item>...</item>
</channel>
</rss>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T01:59:18+00:00Added an answer on June 5, 2026 at 1:59 am

    The problem is caused by the aws namespace in the XML document.

    <aws:weather xmlns:aws="http://www.aws.com/aws">
    

    You could use the childeren method to fetch all nodes that belong to the namespace, than access those.

    You can find a more detailed problem description at http://www.sitepoint.com/simplexml-and-namespaces/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some interesting problem for an hour.. In my flex project, all width
I am trying to read XML elements that have a - in the name.
I am currently trying to parse some xml data into an NSDictionary . This
I have some files that are uuencoded, and I need to decode them, using
I have some files stored at amazon. all in private mode, and since I
I have some script in my default page that redirects users to language specific
I have some XML which contains records and sub records, like this: <data> <record
I have some jquery code that is doing an ajax lookup and returning comma
I have some very simple XML: <properties> <property> <name>BobFish</name> <explaination>Bob is a fish.</explaination> </property>
i want to parse google weather API using NSXML so please give me some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.