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

RE: matching elements only once

Subject: RE: matching elements only once
From: mxmodi@xxxxxxxxxxxxxxx
Date: Mon, 23 Oct 2000 07:52:40 -0500
xsl variable 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


Current Thread

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.