[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] Filtering RSS feed with xsl based on presence of certain words in description


Subject: Re: [xsl] Filtering RSS feed with xsl based on presence of certain words in description
From: ac <ac@xxxxxxxxxxxxx>
Date: Wed, 28 Jan 2009 13:41:23 -0500

...more simply?

<xsl:template match="item[description = ('word1', 'word2', 'word3')]">
  .. process the item ..
</xsl:template>

Is there a performance advantage to the variable or is the match pattern sequence optimized anyway (e.g. Saxon)?

Thanks,
ac/01



How about:

<xsl:variable name="keywords" select="('word1', 'word2', 'word3')"/>

Well, he said he wanted a contains() test not an "=" test. He might have
been wrong of course, people often do contains() when they mean "=", but I
took it at face value.
 <xsl:template match="item[description = $keywords]">
   .. process the item ..
 </xsl:template>


Michael Kay http://www.saxonica.com/


Current Thread