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

Re: count(arvosana) with if condition

Subject: Re: count(arvosana) with if condition
From: "Vasu Chakkera" <vasucv@xxxxxxxxxxx>
Date: Tue, 25 Jun 2002 13:42:56 +0000
if condition in c
The following will help you...

<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:if test="count(//arvosana[text()&lt;3])">
add text..
the no of arvosana with value less than 3 are <xsl:value-of select="count(//arvosana[text()&lt;3])"/>

This prints the no of arvosana with values less than 3.

From: Jarkko.Moilanen@xxxxxx
Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
To: xsl-list <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Subject:  count(arvosana) with if condition
Date: Tue, 25 Jun 2002 14:14:57 +0300 (EEST)


I´m  trying to count the number of such elements where value is 3.
And if the value is lesser than 3 it should insert xsl:text.
I´m doing it by using variable (name=3), but it´s not working. Dunno what
I´m doing wrong.

<?xml version="1.0" encoding="ISO-8859-1" standalone="yes" ?>
<Document title="Keskiarvot kurssien arvosanoista">
<P1Kurssi koodi="P1" name="P1 Johdatus vuorovaikutteiseen mediaan"


XSL-FILE (part of it):

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:output method="html"
encoding="iso-8859-1" indent="yes" />
	<xsl:template match="Document">
<tr bgcolor="white">
<td width="80">
<p><font face="Verdana" size="2">
<xsl:value-of select="$3" />


<xsl:variable name="3">
	<xsl:for-each select="P1Kurssi/P1Arvosanat">
	<xsl:when test="arvosana='3'">
	<xsl:value-of select="count(arvosana)" />
	<xsl:text> - </xsl:text>

Jarkko Moilanen         *You are wise, witty, and wonderful,     *
Researcher/ ITCM        *but you spend too much time             *
jm60697@xxxxxx          *reading this sort of trash.             *
www.uta.fi/~jm60697     *                                        *
GSM: +358 50 3766 927   *                                        *
* ITCM | Information Technology and Crisis Management            *
* http://www.itcm.org                                            *

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

Join the world?s largest e-mail service with MSN Hotmail. http://www.hotmail.com

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

Current Thread


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.
First Name
Last Name
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.