How to use RSS2 parser to parse tags with colon?

Discussion in 'Ruby' started by Mister Yu, Sep 30, 2007.

  1. Mister Yu

    Mister Yu Guest

    Hello all,

    I am trying to user the RSS2 parser to parse the weather feed from
    weatherBug.

    i know how to parse the tags without colon, it just as easy as:
    "result.channel.title"

    but how to i parse something with a colon like <aws:forecast>? how do
    i write the code?

    the tag is under channel tag and it looks like this:
    <aws:weather xmlns:aws="http://www.aws.com/aws">

    <aws:api version="2.0" /><aws:WebURL>http://web.live.weatherbug.com/
    World/Page/SetWorldStation.aspx?
    zcode=Z5546&amp;city_id=61301&amp;world_stat=&amp;lid=WSTAT</
    aws:WebURL>

    <aws:forecasts type="Detailed" date="Sun, 30 Sep 2007 00:00:00
    GMT"><aws:location><aws:city>Westminster</
    aws:city><aws:citycode>61301</aws:citycode><aws:country>United
    Kingdom</aws:country></aws:location>

    <aws:forecast><aws:title alttitle="SUN">Today</aws:title><aws:short-
    prediction>Increasing Clouds</aws:short-prediction><aws:image
    isNight="0" icon="cond066.gif">http://deskwx.weatherbug.com/images/
    Forecast/icons/cond066.gif</aws:image><aws:description>Today</
    aws:description><aws:prediction> Afternoon clouds. Mild. Temperature
    of 16&amp;deg;C. Winds 15km E. Humidity will be 71% with a dewpoint
    of 8&amp;deg; and comfort level of 16&amp;deg;C. There is a 32% chance
    of precipitation.</aws:prediction><aws:high units="°C">16</
    aws:high><aws:low units="°C">8</aws:low></aws:forecast><aws:forecast>

    <aws:forecast><aws:title alttitle="MON">Monday</aws:title><aws:short-
    prediction>Rain</aws:short-prediction><aws:image isNight="0"
    icon="cond005.gif">http://deskwx.weatherbug.com/images/Forecast/icons/
    cond005.gif</aws:image><aws:description>Monday</
    aws:description><aws:prediction>Light rain. Mostly cloudy. Mild,
    Breezy. Temperature of 14&amp;deg;C. Winds 26km ENE. Humidity will be
    85% with a dewpoint of 10&amp;deg; and comfort level of 12&amp;deg;C.
    There is a 55% chance of precipitation.</aws:prediction><aws:high
    units="°C">14</aws:high><aws:low units="°C">12</aws:low></
    aws:forecast><aws:forecast>

    </aws:weather>
    Mister Yu, Sep 30, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Simon Johnson

    Confusion over RSS2.0 Spec

    Simon Johnson, Aug 4, 2004, in forum: XML
    Replies:
    3
    Views:
    507
    Simon Johnson
    Aug 4, 2004
  2. yawnmoth

    questions about rss2's cloud

    yawnmoth, Mar 27, 2007, in forum: XML
    Replies:
    0
    Views:
    381
    yawnmoth
    Mar 27, 2007
  3. KizilSakal

    Problem with the use of colon (:)

    KizilSakal, Aug 12, 2008, in forum: C Programming
    Replies:
    1
    Views:
    303
    KizilSakal
    Aug 12, 2008
  4. KevinSimonson

    Use of Double Colon Operator

    KevinSimonson, Sep 9, 2009, in forum: C++
    Replies:
    2
    Views:
    731
    KevinSimonson
    Sep 15, 2009
  5. NuclearFusion

    Noob: use of the double colon

    NuclearFusion, Mar 26, 2006, in forum: Ruby
    Replies:
    12
    Views:
    175
Loading...

Share This Page