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

Re: replace() and efficiency: troff-to-unicode convers

Subject: Re: replace() and efficiency: troff-to-unicode conversion
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 13 Sep 2006 00:05:42 +0100
convers
>  If I understood correctly, your suggestion was along the 
> lines of:

yes although I misread your regex the first time,and in my first reply
everything is double quoted \\\\ instead of \\ It think th esecond
version (using a key) actually works ad advertised if you just slightly
fix the regex from

regex=".|\\\*?\(..|\\\*\(K\\\(wi">
to

regex="[a-zA-Z&amp;&quot;~]|\\\*?\(..|\\\*\(K\\\(wi">

> There are two matches here: \(?s and \(?c . When my <xsl:choose> finds 
> the first match (it's the first <xsl:when> within the <xsl:choose>), 
> doesn't it just replace all instances of \(?s and then not read the rest 
> of the <xsl:when> lines? That is, won't it fail to find the subsequent 
> \(?c ?

No each xsl:choose only executes one xsl:when but it will be called
multiple times. the string is first split up into a sequence of
substrings that match or dont and then xsl:analyze-string iterates along
that list much liek xsl:for-each with . beimg the matching (or not)
substring at each iteration, and the matching or non matching part being
taken at each step.

run the code i posted (or as ammended above) and you'll see what I
mean...
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-2013 All Rights Reserved.