Re: [xsl] recursive xsl replace

Subject: Re: [xsl] recursive xsl replace
From: Joelle Tegwen <tegwe002@xxxxxxx>
Date: Tue, 08 May 2007 11:43:03 -0500
This isn't quite what I meant.

I figured out a way to get around the missing replace function. My problem is with the recursion. My function only changes the text for one of the glossary items, not all 3 (for this example... there may be more or less).

Thanks!
Joelle

Abel Braaksma wrote:
Joelle Tegwen wrote:
I've been struggling with this for hours and I'm not getting anywhere and I'm behind on an already delayed deadline. Any help would be most appreciated.

<snip />

But it doesn't work. It only replaces the first term.

What am I doing wrong?

PS I'm using the PHP xsl transformer which apparently does not support fn:replace() :P


which is an XSLT 2.0 function and libxsl (which is used by PHP I believe) is an XSLT 1.0 parser. Not sure, but perhaps you can use regexp:replace() from EXSLT extensions. There is a libexslt, not sure you can use it with PHP though: http://xmlsoft.org/XSLT/EXSLT/index.html.


There are many examples online of how to do multiple replace in XSLT 1.0 (in 2.0 it is far easier). Here's one: http://www.stylusstudio.com/xsllist/200404/post70930.html#

Cheers,
-- Abel Braaksma

Current Thread