This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Counting Word Occurences
- To: xsl-list at lists dot mulberrytech dot com
- Subject: Re: [xsl] Counting Word Occurences
- From: David Carlisle <davidc at nag dot co dot uk>
- Date: Tue, 19 Dec 2000 16:51:13 GMT
- References: <4.1.20001219105104.00a77220@jefferson.village.virginia.edu>
- Reply-To: xsl-list at lists dot mulberrytech dot com
<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