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

RE: Xslt 2 stripping out non-numbers

Subject: RE: Xslt 2 stripping out non-numbers
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Wed, 20 Apr 2005 19:41:11 +0100
translate trick xslt
> This is the "double-translate" technique first proposed on this list
> (to the best of my knowledge) by Mike Kay.
> 
> The FXSL template/function 
> 
>     str-filter
> 
> has been shown to perform better than the double-translate technique
> on large strings:
> 
>   http://www.biglist.com/lists/xsl-list/archives/200203/msg01524.html
> 
> 

I suspect most implementations of translate() are likely to be optimized for
a fairly short second argument (the set of characters to be replaced) and
are likely to have performance proportional to length(arg1)*length(arg2).
Where that's the case, the double-translate trick applied to a large input
string is quite likely to generate a call on translate with long values for
both arg1 and arg2 which could obviously be rather inefficient. Using
replace() in XPath 2.0 is likely to perform much better in these
circumstances.

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.