[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Result count in a for-each with an embedded if

Subject: Re: Result count in a for-each with an embedded if
From: Conor Ryan <cryan@xxxxxxx>
Date: Tue, 19 Jun 2001 18:11:17 +0100
embedded if
the following should work: 

........
There were <xsl:value-of select="count(article)"/> articles found.
...........

hope this helps,

Conor.

At 03:56 PM 6/19/01 -0000, you wrote:
>Hi,
>
>Tring to do a count of the results of the following snip:
>
><xsl:template match="articles">
>	<xsl:for-each select="article">
>		<xsl:if test="contains(translate
>(detail,'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ'),trans
>late
>($keyword,'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ'))">
>			<xsl:value-of select="normalize-space(title)"/>
>		</xsl:if>
>	</xsl:for-each>
>	There were XX articles found.
></xsl:template>
>
>Need to return the XX value.
>I can't find a way of putting the contains test into the for-each 
>select so I could use the position()(?).
>
>Ideas would be appreciated.
>
>Thanks,
>Tim.
>
>Example xml:
><articles>
>	<article ID="article1">
>		<title>
>			A Title
>		</title>
>		<detail>
>			Some detail on the subject.
>		</detail>
>	</article>
>	<article ID="article2">
>		.........
>	</article>
>	..........
></articles>
>
> XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>
>
---------
Conor Ryan,
XML Workshop Ltd,
10 Greenmount Industrial Estate, Harolds Cross, Dublin 12, IRELAND.
Email: cryan@xxxxxxx
Phone: +353 1 4547811; Fax: +353 1 4731626
Web: http://www.xmlw.ie/


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.