Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pulling specific item from RSS 1

Status
Not open for further replies.

csteinhilber

Programmer
Aug 2, 2002
1,291
US
I have an RSS feed that I'm transforming to HTML via an XSL stylesheet, server-side with classic ASP.

The feed is a series of news articles. And I need a top 10 view, a view all, and then a detail view which displays the content of a single article. The items in the top 10 and view all pages will link to a common asp page for a detail view.

The top 10 and view all pages were easy. But the detail page is a little tougher than I expected.

Obviously in the XSL I can XPath down to a specific article... like
Code:
<xsl:for-each select='rss/channel/item[position() &lt; 8]'>
   <xsl:apply-templates select="rss/channel/item[guid='12345']" />
that works fine.

Except (and this is why this is in the ASP forum rather than XSLT)... I obviously need to be able to dynamically determine (and populate) the value of the guid I'm looking for.
So... like:
Code:
<xsl:for-each select='rss/channel/item[position() &lt; 8]'>
   <xsl:apply-templates select="rss/channel/item[guid='<%= Request("guid"} %>']" />
I thought I'd be able to generate a dynamic XSL with ASP, but that doesn't seem to be working.

It seems like this should be a fairly common thing that people are doing, but I'm not finding any tips anywhere. Any help would be appreciated!

Thanks in advance,
-Carl
 
Try looking into using the xsl:param tag tag in your XSL sheet. This will let you specify a paramater (similar to a variable) that you can re-use later in your sheet. The bonus is that you can actually set this from your ASP code, provided you load the sheet correctly.

Googling on "xsl:param asp" gave me a few good hits on the subject.

-T

 
No problem. If you have a chance I would love it if you could post back a clipping of your code where you set the param. It's not an issue that has come up for me before and I didn't have time to read those links yesterday. I could definately see some usefulness or this thoughm, and would add it to my archive for future reference (if I added something to my browser bookmarks I would never find it again :p)

-T

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top