xsl-list
[Top] [All Lists]

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

2008-08-18 15:46:57
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

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