W3C home > Mailing lists > Public > www-style@w3.org > March 2001

Determining if an XSLT template has run

From: Jeffrey Yasskin <jyasskin@appcomp.com>
Date: Thu, 29 Mar 2001 21:04:44 -0600
Message-ID: <86BF1235655FD411BF4100C0F017B8A301F83C@SERVER1>
To: www-style@w3.org
I am currently working on a search page based on XSLT, and I need a way to
display a "No Results" page if no results are found. To do this, I would
like to set a variable if the row template doesn't fire in the following
example:
	<xsl:template match="/">
		<h1>Header</h1>
		<xsl:apply-templates />
		<xsl:if test="$fired">
			NO RESULTS!!
		</xsl:if>
	</xsl:template>
	<xsl:template match="row[lots-of-conditions]">
		<xsl:variable name="fired" select="true">
		<p>Stuff</p>
	</xsl:template>
As far as I see, there's no way to do this, so I'm suggesting it for XSLT
2.0.
Received on Thursday, 29 March 2001 22:09:11 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:08 GMT