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 6826621
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:10:09+00:00 2026-05-26T22:10:09+00:00

I want to look at an external rss feed and display it on my

  • 0

I want to look at an external rss feed and display it on my site but there’s some excessive information in there which I don’t want and I also want to add in my own content dependent on the content of the xml.

To try and make my explanation clearer a mock example would be an rss feed which includes the current day of the week and time. I would then want to pull that in, filter out the time to just have the day of the week, and replace that with an image relevant to the day of the week.

Edit: Okay, here is a possible example: Yahoo – Today’s weather rss

This shows the current weather in London (along with a short forecast). How would I look at the text attribute of the yweather:condition node and display an image relevant to it, so if it says “Fog” as it currently does, I would display an image of fog, if it said sun, an image of a sun, and so on.

  • 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-26T22:10:10+00:00Added an answer on May 26, 2026 at 10:10 pm

    Use:

    /*/*/item/yweather:condition/@text
    

    where you have registered in your PL (that hosts the XPath engine) the prefix "yweather", associated to the namespace "http://xml.weather.yahoo.com/ns/rss/1.0".

    XSLT-based verification:

    <xsl:stylesheet version="1.0"
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
     xmlns:yweather="http://xml.weather.yahoo.com/ns/rss/1.0"
     exclude-result-prefixes="yweather">
     <xsl:output omit-xml-declaration="yes" indent="yes"/>
     <xsl:strip-space elements="*"/>
    
     <xsl:template match="/">
         <img src="{/*/*/item/yweather:condition/@text}.jpg"/>
     </xsl:template>
    </xsl:stylesheet>
    

    when applied against the XML document pointed to by the link in the question:

    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    <rss version="2.0" xmlns:yweather="http://xml.weather.yahoo.com/ns/rss/1.0" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#">
        <channel>
            <title>Yahoo! Weather - London, GB</title>
            <link>http://us.rd.yahoo.com/dailynews/rss/weather/London__GB/*http://weather.yahoo.com/forecast/UKXX0085_c.html</link>
            <description>Yahoo! Weather for London, GB</description>
            <language>en-us</language>
            <lastBuildDate>Sun, 20 Nov 2011 2:50 pm GMT</lastBuildDate>
            <ttl>60</ttl>
            <yweather:location city="London" region=""   country="United Kingdom"/>
            <yweather:units temperature="C" distance="km" pressure="mb" speed="km/h"/>
            <yweather:wind chill="7"   direction="0"   speed="3.22" />
            <yweather:atmosphere humidity="100"  visibility="0.9"  pressure="1015.92"  rising="0" />
            <yweather:astronomy sunrise="7:26 am"   sunset="4:05 pm"/>
            <image>
                <title>Yahoo! Weather</title>
                <width>142</width>
                <height>18</height>
                <link>http://weather.yahoo.com</link>
                <url>http://l.yimg.com/a/i/brand/purplelogo//uh/us/news-wea.gif</url>
            </image>
            <item>
                <title>Conditions for London, GB at 2:50 pm GMT</title>
                <geo:lat>51.51</geo:lat>
                <geo:long>-0.13</geo:long>
                <link>http://us.rd.yahoo.com/dailynews/rss/weather/London__GB/*http://weather.yahoo.com/forecast/UKXX0085_c.html</link>
                <pubDate>Sun, 20 Nov 2011 2:50 pm GMT</pubDate>
                <yweather:condition  text="Mostly Cloudy"  code="28"  temp="7"  date="Sun, 20 Nov 2011 2:50 pm GMT" />
                <description><![CDATA[
    <img src="http://l.yimg.com/a/i/us/we/52/28.gif"/><br />
    <b>Current Conditions:</b><br />
    Mostly Cloudy, 7 C<BR />
    <BR /><b>Forecast:</b><BR />
    Sun - Cloudy. High: 9 Low: 8<br />
    Mon - Mostly Cloudy. High: 12 Low: 10<br />
    <br />
    <a href="http://us.rd.yahoo.com/dailynews/rss/weather/London__GB/*http://weather.yahoo.com/forecast/UKXX0085_c.html">Full Forecast at Yahoo! Weather</a><BR/><BR/>
    (provided by <a href="http://www.weather.com" >The Weather Channel</a>)<br/>
    ]]></description>
                <yweather:forecast day="Sun" date="20 Nov 2011" low="8" high="9" text="Cloudy" code="26" />
                <yweather:forecast day="Mon" date="21 Nov 2011" low="10" high="12" text="Mostly Cloudy" code="28" />
                <guid isPermaLink="false">UKXX0085_2011_11_21_7_00_GMT</guid>
            </item>
        </channel>
    </rss>
    <!-- api9.weather.ac4.yahoo.com compressed/chunked Sun Nov 20 07:44:04 PST 2011 -->
    

    produces the wanted result:

    <img src="Mostly Cloudy.jpg"/>
    

    Update: The OP has now provided in a comment the exact wanted output. Below is the transformation that produces this output:

    <xsl:stylesheet version="1.0"
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
     xmlns:yweather="http://xml.weather.yahoo.com/ns/rss/1.0"
     exclude-result-prefixes="yweather">
     <xsl:output omit-xml-declaration="yes" indent="yes"/>
     <xsl:strip-space elements="*"/>
    
     <xsl:template match="/">
        <xsl:text
        disable-output-escaping="yes">&lt;!DOCTYPE HTML></xsl:text>
        <xsl:text>&#xA;</xsl:text>
        <html>
            <head>
                <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
            </head>
            <body>
                <div id="weather">
                      <img src="{/*/*/item/yweather:condition/@text}.jpg"/>
                </div>
            </body>
        </html> 
     </xsl:template>
    </xsl:stylesheet>
    

    when this transformation is applied on the same XML document (above), the wanted result is produced:

    <!DOCTYPE HTML>
    <html>
       <head>
          <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
       </head>
       <body>
          <div id="weather">
             <img src="Mostly Cloudy.jpg"/>
          </div>
       </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to sort an array by 'hits', but I also want to look
I want to look at a production binary and know which revision in the
I want to look up some properties from JNDI configured in glassfish v3 server.
I have a UIProgressView which I want to look like this image. I have
I want to write some values to an external file and use NSDictionary for
I have a php file which pulls some data from external API's, and I
I want to monitor how often some external images are loaded. So my idea
I want to save some data in the user's external directory (ie. SD card),
I built a WCF service which produces JSON. I want to make an external
I want my Rails App to parse external websites for a trackback URL but

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.