Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsOtherProgramming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old October 20th, 2006, 10:25 AM
Zaphod Zaphod is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2006
Posts: 3 Zaphod User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 44 m 40 sec
Reputation Power: 0
Xsl transform of rss feed help please

greetings, Long time reader, First time writer!

My question is this;
I have a rss news feed up and running on a website, but I would like to sift through the 30-40 items provided and display only the ones with a certian word in the title.
For example in the following snippet of an rss feed I would like to display only the 2nd and 3rd items because they contain the word "Bush" in the title(sort of a regex type of search).

Any ideas on how to do this?

~~snip~~~
- <item>
<title>Judge Dismisses Charges Against Woman Who Killed Her Unborn Child</title>
- <link>
- <![CDATA[
http://abcnews.go.com/US/LegalCenter/story?id=2585102&page=1&CMP=OTC-RSSFeeds0312
]]>
</link>
<pubDate>Thu, 19 Oct 2006 14:59:46 -0400</pubDate>
<description>Pregnant Mother Shot Herself in the Stomach, Killing Her Child, Va. Judge Rules Causing Your Own Abortion Is Not a Crime</description>
</item>
- <item>
<title>Bush Accepts Iraq-Vietnam Comparison</title>
- <link>
- <![CDATA[
http://abcnews.go.com/WNT/story?id=2583579&CMP=OTC-RSSFeeds0312
]]>
</link>
<pubDate>Thu, 19 Oct 2006 09:12:02 -0400</pubDate>
<description>George Stephanopoulos Interviews President Bush on Iraq, the Midterms and His Legacy</description>
</item>
- <item>
<title>George Bush's head Caves In During News Conference</title>
- <link>
- <![CDATA[
http://abcnews.go.com/WNT/story?id=2583579&CMP=OTC-RSSFeeds0312
]]>
</link>
<pubDate>Thu, 19 Oct 2006 09:12:02 -0400</pubDate>
<description>George Carlin in Hospital After Laughing Fit Brought On By Presidential Head Implosion during News Confrence</description>
</item> - <item>
<title>'Cover Letters from ****' Expose Poor Quality of College Grads</title>
- <link>
- <![CDATA[
http://abcnews.go.com/Business/CareerManagement/story?id=2582776&page=1&CMP=OTC-RSSFeeds0312
]]>
</link>
<pubDate>Thu, 19 Oct 2006 14:29:04 -0400</pubDate>
<description>A Chicago Adverstising Agency Highlights a Shocking Number of Errors in Job Seekers' Cover Letters</description>
</item>
~~snip~~

Reply With Quote
  #2  
Old October 20th, 2006, 02:15 PM
ChiefWigs1982's Avatar
ChiefWigs1982 ChiefWigs1982 is offline
Cunning Linguist
Click here for more information.
 
Join Date: Mar 2005
Location: I used to live at home, now I stay at the house
Posts: 3,530 ChiefWigs1982 User rank is Major (30000 - 40000 Reputation Level)ChiefWigs1982 User rank is Major (30000 - 40000 Reputation Level)ChiefWigs1982 User rank is Major (30000 - 40000 Reputation Level)ChiefWigs1982 User rank is Major (30000 - 40000 Reputation Level)ChiefWigs1982 User rank is Major (30000 - 40000 Reputation Level)ChiefWigs1982 User rank is Major (30000 - 40000 Reputation Level)ChiefWigs1982 User rank is Major (30000 - 40000 Reputation Level)ChiefWigs1982 User rank is Major (30000 - 40000 Reputation Level)ChiefWigs1982 User rank is Major (30000 - 40000 Reputation Level)ChiefWigs1982 User rank is Major (30000 - 40000 Reputation Level)  Folding Points: 50746 Folding Title: Beginner FolderFolding Points: 50746 Folding Title: Beginner FolderFolding Points: 50746 Folding Title: Beginner Folder
Time spent in forums: 1 Month 1 Week 4 Days 11 h 40 m 32 sec
Reputation Power: 397
You can use the contains() string function to test to see if the
title contains what you're after. Something like:
Code:
<xsl:for-each select="item">
	<xsl:if test="contains(title,'Bush')">
		<p><xsl:value-of select="title" /></p>
	</xsl:if>
</xsl:for-each>
__________________
Support requests via PM will be ignored!
Route of Queue | The General FAQ Thread | HOW TO POST A QUESTION

Perfectly Impossible - is the eagerly awaited debut release from Jayne Sarah - please buy it - it's really good!


Reply With Quote
  #3  
Old October 24th, 2006, 09:10 PM
Zaphod Zaphod is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2006
Posts: 3 Zaphod User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 44 m 40 sec
Reputation Power: 0
Thanks, that is exactly what I was looking for.

Reply With Quote
Reply

Viewing: ASP Free ForumsOtherProgramming Help > Xsl transform of rss feed help please


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump





 Free IT White Papers!
 
Create the Optimal Architecture for your Critical Applications
Warburton's the largest independently owned bakery in the UK faced a number of difficult challenges in providing the most robust yet efficient IT infrastructure for their organization's success. IBM's services combined with their xSeries servers created the perfect platform for their SAP environment with sufficient flexibility, and did so in very time effective fashion.

 
Five Best Practices for Deploying a Successful Service-Oriented Architecture
This white paper describes the benefits you can expect with SOA, and how IBM can help take your business there.

 
Gartner Magic Quadrant for Application Delivery Controllers
Gartner summarizes its view on Application Delivery Controllers, evaluates strengths and weaknesses of solutions, and provides Magic Quadrant reporting for a quick comparison across all vendors. Learn from Gartner how you can benefit from an all-in-one device like Citrix NetScaler that delivers the highest levels of availability, performance and security.

 
Knowledge is Power
What you don't know can hurt you, and is likely costing you money and increasing your security risks during an era of scarce resources. This white paper proposes six key strategies that enterprise security managers can use to improve their network defense posture.

 
Rationalizing the Multi-Tool Environment
The rationalized multi-tool approach is flexible, scalable and cost effective. It provides the necessary input to the IT service management business processes. It preserves prior investments in monitoring tools, empowers technologists to select the best tools with which to do their jobs, and enhances effective response to incidents.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2010 by Developer Shed. All rights reserved. DS Cluster 8 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek