xsl-list
[Top] [All Lists]

Re: [xsl] difference in regexp matches() and analyze-string

2007-12-31 09:14:40
Hi,


Let me get this straight. Is the output you have listed your desired output, or the
current output? It appears that there is something missing in your template.

Check out one of Michael Kay's answers on another case of analyze-string at
http://biglist.com/lists/xsl-list/archives/200702/msg00301.html. Your code does not bring output to the other one because it does not know what to call after the analyze-string
function has been applied. Or, is there something you are trying to do?

Alice


Alice Wei
MIS 2008
School of Library and Information Science
Indiana University Bloomington
ajwei(_at_)indiana(_dot_)edu
812-856-2659

Quoting Martin Honnen <Martin(_dot_)Honnen(_at_)gmx(_dot_)de>:

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/

--~------------------------------------------------------------------
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>
--~--



--~------------------------------------------------------------------
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>
--~--

<Prev in Thread] Current Thread [Next in Thread>