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

Count Nodes

Subject: Count Nodes
From: mxmodi@xxxxxxxxxxxxxxx
Date: Thu, 19 Oct 2000 12:17:29 -0500
xsl keep count
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


Current Thread
  • Count Nodes
    • mxmodi - Thu, 19 Oct 2000 12:17:29 -0500 <=
      • <Possible follow-ups>
      • Kay Michael - Thu, 19 Oct 2000 19:14:34 +0100

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.