[xsl] XPath (regex?) question about $& in an XSLT stylesheet

Subject: [xsl] XPath (regex?) question about $& in an XSLT stylesheet
From: "Mark Wilson" <mark@xxxxxxxxxxxx>
Date: Mon, 18 Aug 2008 15:46:36 -0700
I have an element
<Person>Benes (senior), Frances</Person>.

I can remove the '(senior)' from the data using
<xsl:value-of select="replace(., '\([a-zA-Z]+\)', ' ' )"/>

which gives me
<Person>Benes , Frances</Person>
but I want just the opposite:
<Person>(senior)</Person>

I cannot figure out how to use the predefined variable $& to return the matched string, or the (or even if I can so so in XSLT),.
What is the correct (or better) solution to this problem?
Thanks,
Mark


Current Thread