[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: Mukul Gandhi <mukul_gandhi@xxxxxxxxx>
Date: Sat, 21 May 2005 03:27:36 -0700 (PDT)
where between
Hi Amburose,
  I was thinking how to solve this problem rightly..
Before you try my stylesheet, please study Michael
Kay's answer (it will surely be better than mine :)
)..

Here is the XSLT stylesheet -

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output method="xml" indent="yes" />

<xsl:variable name="date1" select="'04-03-2005'" />
<xsl:variable name="date2" select="'04-05-2005'" />

<xsl:template match="/Employees">
     <result>
         <xsl:for-each select="Employee"> 
             <xsl:variable name="doj"
select="concat(substring(@DOJ,4,2),'-',substring(@DOJ,1,2),'-',substring(@DOJ,7,4))"
/> 
                 <xsl:if test="($doj &gt;= $date1) and
($doj &gt;= $date1)">
                    <xsl:copy-of select="." />
            </xsl:if>
        </xsl:for-each>
    </result>
</xsl:template>

</xsl:stylesheet>

This is an XSLT 2.0 stylesheet , and tested with Saxon
8.4 XSLT processor.

Regards,
Mukul

--- Amburose <ambrose@xxxxxxxxxxxxx> wrote:
> 
> hi,
> 
> i have one xml file. that contain number of
> employess records with basic
> informations like name, age, date of joining ....
> 
> 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.
> 
> 
> Best Wishes,
> amburose

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.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.