This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
xsl:param and attribute testing
- To: <XSL-List at lists dot mulberrytech dot com>
- Subject: [xsl] xsl:param and attribute testing
- From: "Reuel Alvarez" <ralvarez at dmtmedia dot com>
- Date: Mon, 29 Jan 2001 18:31:50 -0500
- Reply-To: xsl-list at lists dot mulberrytech dot com
I'd like to be able to pass a parameter to my xsl stylesheet that will count
nodes with specific attributes. For example, I'd like to count Analyst
elements whose analyst_id attributes are 10, 103, or 998 like so:
<xsl:template match="Analyst">
<xsl:variable name="acount" select="count(Analyst/@id[text()=10
or text()=103 or text()=998]) + 1" />
<xsl:value-of select="$acount" />
</xsl:template>
Is there any way to pass the attributes 10, 103, and 998 (or any other set
of numbers) to the stylesheet using xsl:param? Assuming that I can do that,
how can I specify that the nodes selected contain those parameters that were
passed?
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list