Assuming you were put in an email element, this is an expression that you probably want
<xsl:value-of select="count(record[field[@name='host']/text()='yahoo'])" />
For example, try this XSLT
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/emails"> <xsl:value-of select="count(record[field[@name='host']/text()='yahoo'])" /> </xsl:template> </xsl:stylesheet>
Assuming your XML was well-formed and your CDATA tags were formatted correctly, it should output 3.
Tim c source share