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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using XSL to select specific page elements for RSS

Status
Not open for further replies.

rockyroad

Programmer
Feb 22, 2003
191
US
Hello,

I have read somewhere that it is possible to use XSL to grab only specific information to populate the <description> element for an RSS feed.

Consider an example where a query from a database is looking at something like this and then outputting as XML in RSS format:

Code:
<p class="RSSDescription">Some paragraph suitable for RSS Description</p>
<p>The remaining paragraphs in an article, not to be in the feed description</p>

My question is, how can XSL be utilized to select only those <p> elements with the "RSSDescription" class? Right now my other option is breaking the specific paragraphs out into a differnt database field and filtering on the query, but this seems counter-intuitive and certainly cumbersome on the content generation side.

Any thoughts?

:) Thanks, and Happy New Year!

RR
 
With proper context node idenitied, something like this whatever it would inspire you because the question is deficit to start with.
[tt]<xsl:value-of select="p[@class='RSSDescription']" />[/tt]
 
OK..... ... I think your post will help. I am kind of an XSL newbie, thus why I was asking in this forum. Thanks.
 
RR,

First, there is a decent online tutorial here for learning XSLT.

Second, you have show only the lowest level of your document tree (i.e. the <p> elements). In order for tsuji or me or anyone else to provide better help we need a better problem statement.

Tom Morrison
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top