RE: [xsl] Date Range in XSL

Subject: RE: [xsl] Date Range in XSL
From: "Avula, Raj" <ravula@xxxxxxxxxxx>
Date: Wed, 16 Apr 2003 10:37:40 -0700

			<xsl:for-each select="recorddata">
				<xsl:variable name="new_date"
select="concat(substring(date, 7, 4), substring(date, 1, 2), substring(date,
4, 2))" />
				<xsl:if test="symbol='MSFT' and
$new_date&gt;20030110 and $new_date&lt;20030416">
					<xsl:apply-templates select="." />
				</xsl:if>
			</xsl:for-each>
		</xsl:template>
		
		<xsl:template match="recorddata">
			<xsl:value-of select="date" />
		</xsl:template>


Above one should work. But you have to make sure to pass the Range of Dates
in the format YYYYMMDD

Raj...



-----Original Message-----
From: nshah@xxxxxxxxxxxx [mailto:nshah@xxxxxxxxxxxx]
Sent: Wednesday, April 16, 2003 10:29 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE: [xsl] Date Range in XSL


I am sorry but can you give a working example of how to do this.  This is
the first time i am playing around with XSL and XML.

Thanks for your help..

Nehal
----- Forwarded by Nehal Shah/JerseyCity/Pershing on 04/16/03 01:34 PM
-----
 

                      "Avula, Raj"

                      <ravula@xxxxxxxxxxx>               To:
"'xsl-list@xxxxxxxxxxxxxxxxxxxxxx'"                              
                      Sent by:
<xsl-list@xxxxxxxxxxxxxxxxxxxxxx>                                         
                      owner-xsl-list@xxxxxxxxxxx         cc:

                      rrytech.com                        Subject: RE: [xsl]
Date Range in XSL                                      
 

 

                      04/16/03 01:05 PM

                      Please respond to xsl-list

 

 






You are right David. I missed that part.


Thanks for pointing out.


Thanks,
Raj..



-----Original Message-----
From: David Carlisle [mailto:davidc@xxxxxxxxx]
Sent: Wednesday, April 16, 2003 9:40 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: [xsl] Date Range in XSL


  But How about this.
 <xsl:apply-templates select="recorddata[symbol='MSFT' and
  translate(date, '/', '')&gt;01102003 and translate(date, '/',
  '')&lt;04162003]" />

  Thanks,

That would have worked if the dates had been in yyyy/mm/dd format but
if the parts are not in that order you need to shuffle them

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list





 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread