|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: matching elements only once
Hi I am trying to count the number of times the <TimeSheet> element appears
in the following XML. The code for the variable I have defined is shown
after that.
However, I only get a value of 0 always suggesting that it is considering it empty. Am I missing something.?
Thanks.
XML file:
<Employees>
<Employee>
<EmpName>some name</EmpName>
<EmpUserId>someid</EmpUserId>
<TimeSheets>
<TimeSheet>
<BeginWeek>10/01/2000</BeginWeek>
<EndWeek>10/07/2000</EndWeek>
<WeeklyTotal>40</WeeklyTotal>
</TimeSheet>
<TimeSheet>
<BeginWeek>10/08/2000</BeginWeek>
<EndWeek>10/14/2000</EndWeek>
<WeeklyTotal>40</WeeklyTotal>
</TimeSheet>
</TimeSheets>
</Employee>
<Employee>
<EmpName>employee 2</EmpName>
<EmpUserId>someid-2</EmpUserId>
<TimeSheets>
<TimeSheet>
<BeginWeek>10/01/2000</BeginWeek>
<EndWeek>10/07/2000</EndWeek>
<WeeklyTotal>40</WeeklyTotal>
</TimeSheet>
<TimeSheet>
<BeginWeek>10/08/2000</BeginWeek>
<EndWeek>10/14/2000</EndWeek>
<WeeklyTotal>40</WeeklyTotal>
</TimeSheet>
</TimeSheets>
</Employee>
</Employees>
XSL file:
<xsl:variable name="weektotal">
<xsl:value-of select="count(descendant::TimeSheet[not(child::*)])"/>
</xsl:variable>
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








