Re: Counting Word Occurences
<xsl:variable name="text" select="div/abstract"/> <xsl:if test="contains($text, $keyword)"> If you do that, then text is a node set containing each of the abstract nodes, and when you use a node set in a string context then you get the string value of the first node in the set. <xsl:variable name="text"> <xsl:copy-of select="div/abstract"/> </xsl:variable> <xsl:if test="contains($text, $keyword)"> now text is an rtf (or node set in xslt 1.1) with just a single root node and child abstract nodes. So now when used in a string context you get the string value of the root node, ie th estring value of all the children. David _____________________________________________________________________ This message has been checked for all known viruses by Star Internet delivered through the MessageLabs Virus Control Centre. For further information visit http://www.star.net.uk/stats.asp XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
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