XSLT count()
here is my XML
<?xml version="1.0" encoding="utf-8" ?>
<bookingMain>
<bookingDetails id="1">
<service>1</service>
<clientName>Farhan</clientName>
<bookingRef>Flora</bookingRef>
<invoice>HBK / 20Jan2007 / 12</invoice>
<cost>100 AED</cost>
<pax>2</pax>
<amount>2000.75Dr</amount>
<balance>2000.75Dr</balance>
<bookDate>12-03-2207</bookDate>
</bookingDetails>
.
.
.
.
.
.
</bookingMain>
and here is XSLT
<xsl:template match="/">
<html>
<head>
<title>How to select between two dates</title>
</head>
<body>
<xsl:apply-templates />
</body>
</html>
</xsl:template>
<xsl:template match="bookingMain">
<table width="800" border="1" bordercolor="#0000cc" ID="Table2" cellpadding="0" cellspacing="0">
<tr>
<td colspan="9" height="6" bgcolor="#000099"></td>
</tr>
<tr bgcolor="#ccccff" class="tdfont">
<td>ID</td>
<td>Service #</td>
<td>Client Name</td>
<td>Booking Ref.</td>
<td>Invoice</td>
<td>Cost</td>
<td>Persons</td>
<td>Amount</td>
<td>Balance</td>
</tr>
<xsl:apply-templates select="//bookingDetails[concat(substring-after(substring-after(bookDate,'-'),'-'),substring(substring-after(bookDate,'-'),1,2),substring-before(bookDate,'-')) >= concat(substring-after(substring-after($chkIDate,'-'),'-'),substring(substring-after($chkIDate,'-'),1,2),substring-before($chkIDate,'-')) and concat(substring-after(substring-after(bookDate,'-'),'-'),substring(substring-after(bookDate,'-'),1,2),substring-before(bookDate,'-')) <= concat(substring-after(substring-after($chkODate,'-'),'-'),substring(substring-after($chkODate,'-'),1,2),substring-before($chkODate,'-'))]" />
</table><p />
</xsl:template>
<xsl:template match="bookingDetails">
<tr>
<td><xsl:value-of select="@id" /></td>
<td><xsl:value-of select="service" /></td>
<td><xsl:value-of select="clientName" /></td>
<td><xsl:value-of select="bookingRef" /></td>
<td><xsl:value-of select="invoice" /></td>
<td><xsl:value-of select="cost" /></td>
<td><xsl:value-of select="pax" /></td>
<td><xsl:value-of select="amount" /></td>
<td><xsl:value-of select="balance" /></td>
</tr>
</xsl:template>
[u]basically i am selection the values between two dates, now i want to calculate the total number f IDs by the above applied template. when i use the <xsl:value-of select="count(@id)" /> it only gives the current id, means does not return the exact value..can someone suggest where i should put the count() fucntion. </u>
I Love XML and family
__________________
I Love XML and family
|