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
ASP Free Loyal (3000 - 3499 posts)
 
Join Date: Mar 2005
Location: I used to live at home, now I stay at the house
Posts: 3,385 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 3 Days 9 h 1 m 16 sec
Reputation Power: 307
Facebook
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

Sign up with Matched.co.uk and earn up to £15 per website every month!


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


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





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT