|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Count Nodes
Hi,
I have the following XML.
<Employees>
<Employee>
<EmpName>Maulik Modi</EmpName>
<EmpUserId>mxmodi</EmpUserId>
<TimeSheets>
<TimeSheet>
<BeginWeek>10/01/2000</BeginWeek>
<EndWeek>10/07/2000</EndWeek>
<WeeklyTotal>40</WeeklyTotal>
<DETMHours>40</DETMHours>
<OtherHours>0</OtherHours>
</TimeSheet>
<TimeSheet>
<BeginWeek>10/08/2000</BeginWeek>
<EndWeek>10/14/2000</EndWeek>
<WeeklyTotal>40</WeeklyTotal>
<DETMHours>35</DETMHours>
<OtherHours>5</OtherHours>
</TimeSheet>
</TimeSheets>
</Employee>
<Employee>
<EmpName>Jeff Damukaitis</EmpName>
<EmpUserId>jddamukaitis</EmpUserId>
<TimeSheets>
<TimeSheet>
<BeginWeek>10/01/2000</BeginWeek>
<EndWeek>10/07/2000</EndWeek>
<WeeklyTotal>42</WeeklyTotal>
<DETMHours>40</DETMHours>
<OtherHours>2</OtherHours>
</TimeSheet>
<TimeSheet>
<BeginWeek>10/08/2000</BeginWeek>
<EndWeek>10/14/2000</EndWeek>
<WeeklyTotal>45</WeeklyTotal>
<DETMHours>35</DETMHours>
<OtherHours>10</OtherHours>
</TimeSheet>
</TimeSheets>
</Employee>
</Employees>
A snippet of the xsl is as follows:
<xsl:template match="/">
<xsl:apply-templates select="//Employee" >
<xsl:sort select="EmpName"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="Employee">
<xsl:attribute name="id">r<xsl:value-of select="position()"/>c1</xsl:attribute>
<table>
<tr>
<xsl:apply-templates select="TimeSheets/TimeSheet" />
</tr>
</table>
</xsl:template>
<xsl:template match="TimeSheet">
<xsl:choose>
<xsl:when test="rownumber=1">
<td>
do this...
</td>
</xsl:when>
<xsl:when test="rownumber=2">
<td>
do this...
</td>
</xsl:when>
</xsl:choose>
</xsl:template>
</xsl:template>
I am trying to keep a count of the rownumber and pass it down as each one is picked up. And I am having trouble with that. Could anyone throw any
suggestions.
Thanks,
Maulik
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








