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

RE: xsl Filter Question

Subject: RE: xsl Filter Question
From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx>
Date: Tue, 23 Jul 2002 09:08:59 +0100
xslt strip punctuation
> This filter works fine :
> <xsl:for-each  select="report/row[col='some value']">
> 
> But how do filters for >, < in case of text, number and date data ?
> 
> I tried this
> <xsl:for-each  select="report/row[col>'some value']">
> But it did not work.
> 

XPath 1.0 offers "<" and ">" only for numeric values. For other data
types you need to wait till XPath 2.0, or use a workaround.

For dates in iso format, you can strip the punctuation using
translate(), so that 2002-07-23 becomes 20020723, then you can compare
dates as numbers.

For comparing strings alphabetically, the best solution is probably an
extension function, though you can probably do it in XSLT (exploiting
xsl:sort) if you're determined enough.

Michael Kay
Software AG
home: Michael.H.Kay@xxxxxxxxxxxx
work: Michael.Kay@xxxxxxxxxxxxxx 


 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.