|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Filtering RSS feed with xsl based on presence of
> I'm trying to filter an external rss feed using xls so that > only those feed items that contain at least one of a list of > words are selected. The code below does that, but I'm > wondering if there isn't a more succint and easier to > maintain way, XSLT 1.0 isn't known for its succinctness. In 2.0 I would do: <xsl:variable name="keywords" as="xs:string*"> <w>word1</w> <w>word2</w> <w>word3</w> </xsl:variable> <xsl:function name="f:matches-keyword" as="xs:boolean"> <xsl:param name="in" as="xs:string"/> <xsl:sequence select="some $w in $keywords satisfies contains($in, $w)"/> </xsl:function> <xsl:template match="item[f:matches-keyword(description)]"> .. process the item .. </xsl:template> <xsl:template match="item"> .. do nothing .. </xsl:template> Michael Kay http://www.saxonica.com/
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|






