Re: [xsl] the match() function

Subject: Re: [xsl] the match() function
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 21 Apr 2005 10:41:41 +0100
> Im not sure what you mean by 'regular expression'. There is no 
> [a-z][A-Z][0-9] expression in my <xsl:if> statement

matches takes a regular expression as its second argument, you have
given it $matchWith, but you still haven't shown us what string that is.
Whatever it is, it is not a valid regular expression.

The string is somewhat strangly set to be select="parent::definition"
which means that the system is going to the parent element and then
taking the string value of that, ie all the character data of all
descendents of the parent. this is a very big string and it is not
surprising that it does not have the correct syntax for a regular
expression. You get an error message in character 600 and something.

Almost certainly you didn't intend that to be the regular expression but
you have not said what you are trying to do.

As it is your matches() function will never do anything useful, you have

    <xsl:variable name="matchTo" select="parent::node()"/>
    <xsl:variable name="matchWith" select="parent::definition"/>

So if the parent node is definition these two variables are identical,
and if the parent node is not definition matchWith is the empty

What are you trying to test?


This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:

Current Thread