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

RE: get Data BETWEEN FromDate and ToDate

Subject: RE: get Data BETWEEN FromDate and ToDate
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Fri, 20 May 2005 14:27:19 +0100
ge xs date
> now i want how to get particular employees covered  between 
> two different
> date of join date(example Fromdate and Todate ).
> 
> please tell the me Xpath / XSL expression.

If the source documents have a schema, and the attributes are defined in the
schema as being of type xs:date, and you are using a schema-aware XSLT 2.0
processor, then you can just write

employee[@FromDate le $d and @ToDate ge $d]

If you are not using a schema, but you are using XSLT 2.0, and your dates
are stored in the ISO 8601 format that XML Schema uses, then you can still
do the same kind of comparison but you need to do a little more work:

employee[xs:date(@FromDate) le $d and xs:date(@ToDate) ge $d]

If you are not using a schema and your dates are in some other format, or if
you are using XSLT 1.0, then you will need to do even more work, but this
then depends entirely on the format you are starting with.

Michael Kay
http://www.saxonica.com/

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.