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

Re: Simple suggestion for XSLT

Subject: Re: Simple suggestion for XSLT
From: David LeBlanc <whisper@xxxxxxxxxxxxx>
Date: Sun, 09 May 1999 01:34:04 -0700
xsl substring after last occurrence
Brevity came to mind so fast it left skid marks!

Dave LeBlanc

At 02:19 PM 5/9/99 +0700, you wrote:
>Why would this be useful given that
>
>substring-after(substring-after("1999/04/01", "/"), "/") returns "01"
>
>and
>
>substring-before(substring-after("1999/04/01", "/"), "/") returns "04"
>
>and
>
>concat(substring-before("1999/04/01", "/"),
>       "/",
>       substring-before(substring-after("1999/04/01", "/"), "/"))
>returns "1999/04"
>
>?
>
>"Laurent M." wrote:
>> 
>> I don't know if it is worth a dime, but here it is:
>> 
>> 6.2.5 Strings
>> 
>> The functions substring-before() and substring-after() only work with the
>> FIRST occurrence of the first argument, wouldn't it be interesting to have
>> a symmetrical couple of functions working on the LAST occurrence.
>> Something like
>> 
>> reverse-substring-before()
>> Returns the substring of the first argument that precedes the LAST
>> occurrence ...
>> ex: reverse-substring-before("1999/04/01", "/") returns "1999/04"
>> 
>> and
>> 
>> reverse-substring-after()
>> Returns the substring of the first argument that follows the LAST
>> occurrence ...
>> ex: reverse-substring-before("1999/04/01", "/") returns "01"
>> 
>> I understand the functionality could be implemented using extension
>> functions, but a 'native' version would be available across all XSLT
>> implementations.
>> 
>> What about also accessing the "04" (in "1999/04/01") ?
>> 
>> Apologies if someone already made the same suggestion (I found no evidence
>> of it the xsl-editors list).
>> 
>> A good day to everyone, and a big kudos for the great work.
>
>
> 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

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.