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

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

Subject: Re: difference in regexp matches() and analyze-string
From: Alice Wei <ajwei@xxxxxxxxxxx>
Date: Mon, 31 Dec 2007 11:14:11 -0500
Re:  difference in regexp matches() and analyze-string
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@xxxxxxxxxxx 812-856-2659

Quoting Martin Honnen <Martin.Honnen@xxxxxx>:

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

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.