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

Re: Stylesheet Optimization -- How to Make It Faster

Subject: Re: Stylesheet Optimization -- How to Make It Faster
From: David Carlisle <davidc@xxxxxxxxx>
Date: Tue, 28 Nov 2006 14:04:27 GMT
build stylesheet
I think you are doing 

concat('(^|\W)(',ati:escape(.),')($|\W)'))]

on every element of $abbreviations twice for each text node in teh
document, once in the match pattern to see if it matches, and once again
if it does match to build search-str (saxon may optimise away some of
the repeated, code, you never can tell:-)

But anyway you could, when building   <xsl:variable name="abbreviations"
stick the escaped, concatenated regexp into an attribute on the element
somewhere so that you didn't to do this each time.

You are building up a big regexp of the form
(aaa)|(bbb)|(ccc)
and then if it matches looping through all the regex-group() to see
which has a non empty match, I don't think you need to do that, just
use the key that represents the replacement, and look up the replacement
by name not by number

something like
    <xsl:analyze-string select="$input" regex="{$regex}">
              <xsl:matching-substring>
      <xsl:sequence select="key('abbrev',.,$abbreviations)"/>
              </xsl:matching-substring>

David

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-2007 All Rights Reserved.