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

Filtering Child Elements Between Two Values

Subject: Filtering Child Elements Between Two Values
From: "Sendrey, John" <jsendrey@xxxxxxxxxxx>
Date: Mon, 13 Aug 2001 21:04:54 -0700
john sendrey
I'm using the following:

<xsl:for-each select="students/student[($stopdate >=
certifications/certification/date) and (certifications/certification/date >=
$startdate)]">

to locate all students who have a certification date between $startdate and
$stopdate, inclusive ( YYYYMMDD format )

<students>
  <student>
    <certifications>
      <certification>
        <date>20010701</date>
        <name>MCP</name>
      </certification>
      <certification>
        <date>20010801</date>
        <name>MCSE</date>
      </certification>
    </certifications>
  </student>
  .
  .
  .
</students>

However, in my results, I get the student returned if I choose $startdate =
'20010708' and $stopdate = '20010721' even though neither of the two dates
in the sample data above appears between this date range.  It appears to be
selecting the student because at least one date is greater than '20010708'
and at least one date is less than '20010721' even though neither date falls
in between the two date values.  How can I select a student only if he/she
has at least one certification date that falls in between $startdate and
$stopdate?

 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.