[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: replace() and efficiency: troff-to-unicode convers
> <xsl:template match="text()"> > <xsl:analyze-string select="." regex="\\\\\\(\\\?([a-z])" > <xsl:matching-substring> > <xsl:choose> > <xsl:when test="regex-group(1)='s'">... > <xsl:when test="regex-group(1)='c'">... > > What I don't understand is what an XSLT 2 processor does when > I pass it a text node like: > > abab\(?sabab\(?cabab > > 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 ? The xsl:matching-substring instruction is executed once for each match. So it's executed once to process \(?s, and once to process \(?c. In the first case, the first xsl:when fires. In the second case, the second xsl:when fires. Michael Kay http://www.saxonica.com/
|
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
|