|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Stylesheet Optimization -- How to Make It Faster
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
|
Purchase Stylus Studio Online Today!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|






