xsl-list
[Top] [All Lists]

Re: [xsl] values in sequence after tokenize

2006-07-11 07:33:23
On 7/11/06, Michael Kay <mike(_at_)saxonica(_dot_)com> wrote:
The regex given to tokenize determines the separator between tokens, not the
content of the tokens.
I'm not quite sure what result you expect here (or in general). You can
probably tackle it using xsl:analyze-string, which is more powerful than
tokenize().

Using xsl:analyze-string, how would I add a count to the matching items:

<xsl:analyze-string select="$string" regex=".{{1,6}}\^">
 <xsl:matching-substring>
   <line count="{ ?? }"><xsl:value-of select="."/></line>
 </xsl:matching-substring>
 <xsl:non-matching-substring>
   <non><xsl:value-of select="."/></non>
 </xsl:non-matching-substring>
</xsl:analyze-string>

...so that the output would be:

<line count="1">....
<line count="2">....

Is this possible or does it require two passes?

thanks
andrew

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--