Subject: Re: [xsl] difference in regexp matches() and analyze-string From: Alice Wei <ajwei@xxxxxxxxxxx> Date: Mon, 31 Dec 2007 11:14:11 -0500 |
Alice Wei MIS 2008 School of Library and Information Science Indiana University Bloomington ajwei@xxxxxxxxxxx 812-856-2659
Ruud Grosmann wrote:
<xsl:template match="al"> <xsl:variable name='txt' select="./text()"/> <xsl:variable name='re2' select="concat('^(', '2\.)', '\s+(.*)$')" as="xs:string"/>
<xsl:if test="matches($txt, $re2)"> <xsl:text>MATCH</xsl:text> </xsl:if> <xsl:analyze-string select="$txt" regex="$re2" >
I think you want <xsl:analyze-string select="$txt" regex="{$re2}" > here to have the constructed string bound to re2 as the regular expression and not the literal string "$re2"
--
Martin Honnen http://JavaScript.FAQTs.com/
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] difference in regexp matc, Martin Honnen | Thread | Re: [xsl] difference in regexp matc, Manfred Staudinger |
Re: [xsl] difference in regexp matc, Martin Honnen | Date | Re: [xsl] difference in regexp matc, Manfred Staudinger |
Month |