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

  • Home
  • SEARCH
  • 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 4566914
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T18:51:22+00:00 2026-05-21T18:51:22+00:00

I’m using the weather.com web service to request current conditions for a location, and

  • 0

I’m using the weather.com web service to request current conditions for a location, and am parsing the current temperature, feels like temp and current condition icon to my Flash application. The Current Temperature and Feels Like Temperature nodes are nested within NowItems -> NowItem while WeatherToday is further along in the feed. I’ve written the following in AS3:

public class Main extends MovieClip
{

    public function Main()
    {

        var urlRequest:URLRequest = new URLRequest("WebServiceURL");
        var urlLoader:URLLoader=new URLLoader();

        urlLoader.addEventListener(Event.COMPLETE, onXmlLoaded);
        urlLoader.load(urlRequest);
    }
    private function onXmlLoaded(event:Event):void
    {
        XML.ignoreWhitespace = true;
        var urlLoader:URLLoader = event.currentTarget as URLLoader;
        var resultXML:XML = XML(urlLoader.data);
        trace(resultXML.NowItems.NowItem.CURRENT TEMPERATURE.Value);
        trace(resultXML.NowItems.NowItem.FEELS LIKE.Value);
        trace(resultXML.WeatherToday.Icon);
        var lowtemp_label :TextField = new TextField();
        addChild(lowtemp_label);
        var hitemp_label :TextField=new TextField();
        addChild(hitemp_label);
        var condicon_label :TextField=new TextField();
        addChild(condicon_label);
        lowtemp_label.text = resultXML.minTemp;
        hitemp_label.text= resultXML.maxTemp;
        condicon_label.text=resultXML.icon;
        }

    }

Here’s some of the XML:

<rss version="2.0" xmlns:a10="http://www.w3.org/2005/Atom">
<channel>
<title>WEATHERSCAPE</title>
<link>http://www.weatherchannel.com.au/</link>
<description>WEATHERSCAPE DATA</description>
<category>Weather</category>
<item>
  <guid isPermaLink="false">18b88e0b-b53f-41a3-bdfb-0762ae440f60</guid>
  <link>http://www.weatherchannel.com.au/</link>
  <title>Weather</title>
  <description>&lt;?xml version="1.0" encoding="utf-16"?&gt;

&lt;LocalWeather xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;

&lt;AreaType&gt;suburb&lt;/AreaType&gt;

&lt;AreaId&gt;555&lt;/AreaId&gt;

&lt;AreaName&gt;SYDNEY&lt;/AreaName&gt;

&lt;UTCOffset&gt;600&lt;/UTCOffset&gt;

&lt;ForecastCreated&gt;2011-04-29T17:10:25Z&lt;/ForecastCreated&gt;

&lt;ObservationsCreated&gt;2011-04-29T17:00:00Z&lt;/ObservationsCreated&gt;

&lt;NowItems&gt;

&lt;NowItem&gt;

  &lt;Label&gt;CURRENT TEMPERATURE&lt;/Label&gt;

  &lt;Value&gt;16.7&lt;/Value&gt;

  &lt;Units&gt;°C&lt;/Units&gt;

  &lt;Change&gt;STEADY&lt;/Change&gt;

&lt;/NowItem&gt;

&lt;NowItem&gt;

  &lt;Label&gt;FEELS LIKE&lt;/Label&gt;

  &lt;Value&gt;16.9&lt;/Value&gt;

  &lt;Units&gt;°C&lt;/Units&gt;

  &lt;Change&gt;STEADY&lt;/Change&gt;

&lt;/NowItem&gt;

&lt;NowItem&gt;

  &lt;Label&gt;DEW POINT&lt;/Label&gt;

  &lt;Value&gt;16&lt;/Value&gt;

  &lt;Units&gt;°C&lt;/Units&gt;

  &lt;Change&gt;DOWN&lt;/Change&gt;

&lt;/NowItem&gt;

&lt;NowItem&gt;

  &lt;Label&gt;HUMIDITY&lt;/Label&gt;

  &lt;Value&gt;96&lt;/Value&gt;

  &lt;Units&gt;%&lt;/Units&gt;

&lt;/NowItem&gt;

&lt;NowItem&gt;

  &lt;Label&gt;WIND SPEED&lt;/Label&gt;

  &lt;Value&gt;9&lt;/Value&gt;

  &lt;Units&gt;km/h&lt;/Units&gt;

  &lt;Change&gt;STEADY&lt;/Change&gt;

  &lt;Direction&gt;SW&lt;/Direction&gt;

&lt;/NowItem&gt;

&lt;NowItem&gt;

  &lt;Label&gt;WIND GUSTS&lt;/Label&gt;

  &lt;Value&gt;15&lt;/Value&gt;

  &lt;Units&gt;km/h&lt;/Units&gt;

&lt;/NowItem&gt;

&lt;NowItem&gt;

  &lt;Label&gt;PRESSURE&lt;/Label&gt;

  &lt;Value&gt;1022&lt;/Value&gt;

  &lt;Units&gt;hPa&lt;/Units&gt;

  &lt;Change&gt;STEADY&lt;/Change&gt;

&lt;/NowItem&gt;

&lt;NowItem&gt;

  &lt;Label&gt;RAIN SINCE 9AM&lt;/Label&gt;

  &lt;Value&gt;9&lt;/Value&gt;

  &lt;Units&gt;mm&lt;/Units&gt;

  &lt;Change&gt;N/A&lt;/Change&gt;

&lt;/NowItem&gt;

&lt;NowItem&gt;

  &lt;Label&gt;FIRE DANGER LEVEL&lt;/Label&gt;

  &lt;Value&gt;UNAVAILABLE&lt;/Value&gt;

  &lt;Units&gt;N/A&lt;/Units&gt;

&lt;/NowItem&gt;

&lt;/NowItems&gt;

&lt;WMOID&gt;94768&lt;/WMOID&gt;

&lt;SiteId&gt;66062&lt;/SiteId&gt;

&lt;WeatherStation&gt;SYDNEY&lt;/WeatherStation&gt;
&lt;WeatherToday&gt;

&lt;Icon&gt;Fewshowers&lt;/Icon&gt;

&lt;FriendlyName&gt;Few showers&lt;/FriendlyName&gt;

&lt;Precis&gt;Few showers.&lt;/Precis&gt;

&lt;MaxTemp&gt;22&lt;/MaxTemp&gt;

&lt;MinTemp&gt;17&lt;/MinTemp&gt;

&lt;Units&gt;°C&lt;/Units&gt;

&lt;MorningIcon&gt;Showers&lt;/MorningIcon&gt;

&lt;AfternoonIcon&gt;Fewshowers&lt;/AfternoonIcon&gt;

&lt;EveningIcon&gt;Showers&lt;/EveningIcon&gt;

&lt;MorningPrecis&gt;Showers&lt;/MorningPrecis&gt;

&lt;AfternoonPrecis&gt;Few showers&lt;/AfternoonPrecis&gt;

&lt;EveningPrecis&gt;Showers&lt;/EveningPrecis&gt;

&lt;/WeatherToday&gt;

I get compiler errors on the lines requesting the Current Temperature and Feels Like, as they have spaces in them? What syntax do I use to reference these nodes given that they have spaces? Is this the correct way to reference these nodes, or are there simpler methods? When I reference the nodes in my label text (last 3 lines), do I use the fully qualified node as is in my trace statements?

Thanks much!!

  • 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-05-21T18:51:23+00:00Added an answer on May 21, 2026 at 6:51 pm

    Inside of the description node is an XML STRING that is not XML
    you need to get the description node then convert it to xml to parse it

    [EDIT]
    OK, what you have in your example is basically 2 XML files one inside the other.
    So what we need to do is parse out the description node you can learn how to do that from HERE and HERE is a good example of a loader

    Once you have successfully obtained the contents of the description node you now have to unescape the data because it has been converted to html friendly format.(pretty sure the unescape function will handle this if not post another question on here about how to convert it – sorry no time to test right now)
    Example:

    &lt should be converted to <

    After the string has been converted you will create a new XML: object off of that and then access the node you want like you did when you parsed the server response.

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

Sidebar

Related Questions

I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Seemingly simple, but I cannot find anything relevant on the web. What is the
I'm making a simple page using Google Maps API 3. My first. One marker
We're building an app, our first using Rails 3, and we're having to build
I have some data like this: 1 2 3 4 5 9 2 6
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
In order to apply a triggered animation to all ToolTip s in my app,

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.