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

Using parameter as regex in matches() function

Subject: Using parameter as regex in matches() function
From: <Dave.McGovern@xxxxxxxxxxx>
Date: Thu, 29 May 2008 17:46:00 -0400
 Using parameter as regex in matches() function
I am using XSLT 2.0 using the Altova XMLSpy 2008 built-in engine.

I am trying to use an xsl:param parameter name as my regex within a
matches() function.

I am passing the parameter in via a call to a named template as shown

<xsl:call-template name="assign_id">
<xsl:with-param name="criteria_name"><xsl:value-of

Here is the called template:
<xsl:template name="assign_id">
<xsl:param name="criteria_name">NULL</xsl:param>
<xsl:attribute name="id"><xsl:value-of
<xsl:value-of select="."/>

With the problematic part being:

The problem is that I want to set boundaries for my regex using the ^
and $ meta-characters.  As I am using it above, the matches() function
is behaving more like contains().

For example, if $criteria-name is set to "Reporting Group" on a
particular iteration, I am getting matches on "Reporting Group", "From
Reporting Group", "To Reporting Group", "Reporting Group Type", etc.

I want to restrict this to only match on the exact "Reporting Group"

I have tried various quoting and backslash-escaping constructs to no

I think this may be because the same metacharacter '$' is used for both
the param name and to set the end boundary of the regex, but I'm not
sure why escaping it wouldn't work if this is the case?

Any ideas?
Thanks in advance,

Current Thread


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.
First Name
Last Name
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.