xsl-list
[Top] [All Lists]

Re: [xsl] EXSLT replace to XSLT 2.0 replace

2010-04-14 03:57:23
Dear Patrick,

in addition to what Wolfgang said:

- There is an undocumented feature in Saxon that will allow you to preserve the passive group (?: ... ): http://www.biglist.com/lists/lists.mulberrytech.com/xsl-list/archives/201002/msg00365.html - If you change (?: ... ) to ordinary groups, you'll have to increment the backreference numbers to '$2$3$4'


So either:
    <xsl:value-of select="replace(
                             .,

'(?:((_dot_)+(_at_)(_dot_)+\(_dot_)[a-zA-Z]+)|([\p{Lu}|\p{Ll}]\p{Ll}+)-([\p{Ll}]+))',
                            '$1$2$3',
                            '!'
                          )"/>
or:
    <xsl:value-of select="replace(
                             .,

'(((_dot_)+(_at_)(_dot_)+\(_dot_)[a-zA-Z]+)|([\p{Lu}|\p{Ll}]\p{Ll}+)-([\p{Ll}]+))',
                            '$2$3$4'
                          )"/>


Gerrit

On 14.04.2010 10:48, Wolfgang Laun wrote:
Omit the 'g', which replace() does anyway.

Omit the '(?: ... )" from the regular expression. (This is uncounted
grouping, which isn't important here.

The | in  (\p{Lu}|\p{Ll}]  looks suspicious. These are alternatives,
anyway, within []

-W

On Wed, Apr 14, 2010 at 9:48 AM, Szabo, Patrick (LNG-VIE)
<patrick(_dot_)szabo(_at_)lexisnexis(_dot_)at>  wrote:
Hi,

I'm using Saxon 9 and XSLT 2.0

I'm currently updateing a few 1.0 Stylesheets to 2.0.
In one of those Stylesheets i've found this:

<xsl:value-of select="regexp:replace(.,
'(?:((_dot_)+(_at_)(_dot_)+\(_dot_)[a-zA-Z]+)|([\p{Lu}|\p{Ll}]\p{Ll}+)-([\p{Ll}]+))',
 'g',
'$1$2$3')"/>

Is there a way to to that in 2.0 without EXSLT ?!
I - of course - wanted to try it with replace() but i cant seem to
figure it out.

best regards...

Patrick Szabo
  XSLT-Entwickler

Tel.: +43 (1) 534 52 - 1573
Fax: +43 (1) 534 52 - 146

Patrick(_dot_)Szabo(_at_)lexisnexis(_dot_)at

LexisNexis Verlag ARD Orac GmbH&  Co KG
Marxergasse 25, 1030 Wien
FN 8333f, Handelsgericht Wien
http://www.lexisnexis.at/





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



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


--
Gerrit Imsieke
Geschäftsführer / Managing Director
le-tex publishing services GmbH
Weissenfelser Str. 84, 04229 Leipzig, Germany
Phone +49 341 355356 110, Fax +49 341 355356 510
gerrit(_dot_)imsieke(_at_)le-tex(_dot_)de, http://www.le-tex.de

Registergericht / Commercial Register: Amtsgericht Leipzig
Registernummer / Registration Number: HRB 24930

Geschäftsführer: Gerrit Imsieke, Svea Jelonek,
Thomas Schmidt, Dr. Reinhard Vöckler

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