xsl-list
[Top] [All Lists]

RE: count() function

2004-04-02 04:45:32
count($title[starts-with(.,'A')])

Michael Kay 

-----Original Message-----
From: james walker [mailto:jameswalkerandy(_at_)hotmail(_dot_)com] 
Sent: 02 April 2004 10:12
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] count() function

I am using a count function to count th enumber of <title> 
tgas in an xml 
file which contain a certain starting letter.
e.g. $alph = 'A'
<xsl:variable name="countletter" select="count(number of 
titles with a 
starting letter of a)"/>
<xsl:if test="($countletter > 0)">
<p><xsl:value-of select="$alph"/></p>
</xsl:if>

How would i write the test case for the xsl:if?
would u do some sort of string comparison like 
not(starts-with($countletter, 
'0'))??

i can't use keys as the xml  is coming from multiple files.
cheers
james

_________________________________________________________________
Use MSN Messenger to send music and pics to your friends 
http://www.msn.co.uk/messenger


--+------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--+--





<Prev in Thread] Current Thread [Next in Thread>