Advertisement

07.23.2008 at 09:31AM PDT, ID: 23589140 | Points: 500
[x]
Attachment Details

Use Style sheet to filter rss feed for images only??

Asked by Ricky11 in RSS, Extensible Stylesheet Language Transformation (XSLT)

The feed i need to parse and filter for images is

http://www.news.gov.hk/rss/news/topstories_en.xml

Some of the stories have images and some dont bascially i want the ones that have images?
can i use

I think i should be able to using a simple style sheet right?

below is the style sheet that i want to use for the above feed, but i dont know how to just filter the images ...

<?xml version="1.0"?>
<xsl:stylesheet version="1.0"

xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" indent="yes"/>
<xsl:param name="TITLE"/>

<xsl:template match="rss">
  <!-- Do not show channel image -->
  <xsl:for-each select="channel/item[position() &lt; 2]">
   


    <xsl:value-of

select="title"/>
</br>

    <!-- only display markup for description if it's present

-->
    <xsl:value-of disable-output-escaping="yes"

select="description"/>

    </br>
   
</br>
  </xsl:for-each>
</xsl:template>

<xsl:template match="description">
 

    <xsl:value-of select="."/>
  </br>
</xsl:template>

</xsl:stylesheet>Start Free Trial
 
Keywords: Use Style sheet to filter rss feed for im…
 
Loading Advertisement...
 
[+][-]07.23.2008 at 10:09PM PDT, ID: 22076232

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.24.2008 at 04:02AM PDT, ID: 22077745

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.24.2008 at 09:58AM PDT, ID: 22081227

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.24.2008 at 11:32AM PDT, ID: 22082111

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.25.2008 at 09:05AM PDT, ID: 22089849

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628