Project

Profile

Help

replace function doesn't work as expected

Added by Anonymous about 18 years ago

Legacy ID: #3701377 Legacy Poster: Nate Delage (ndelage88)

Hi, I might be using this fuction incorrectly but I'm using an example from: http://www.zvon.org/xxl/XSL-Ref/Tutorials/Regular-Expressions/re3.html With the following xml: <?xml version="1.0" encoding="utf-8"?> <aaa>How do you do?</aaa> And the following xsl: <xsl:template match="/aaa"> <xxx> <xsl:value-of select="replace(.,'o.','#')"/> </xxx> </xsl:template> I was expecting the following output: <xxx>H# d#y# d#</xxx> But instead I get: <xxx>How do you d#</xxx> Am I using 'replace' incorrectly or is this function not completly implemented? Possibly my version of java is at fault? Testing done with Saxon 8.7.1 and gij (GNU libgcj) version 4.1.0 Thanks for any help! -Nate


Replies (1)

RE: replace function doesn't work as expected - Added by Anonymous about 18 years ago

Legacy ID: #3701420 Legacy Poster: Michael Kay (mhkay)

It works fine with JDK 1.5. I tried using the GNU regex library as part of the port to .NET and found it very defective (so I used the .NET regex library instead). I could have implemented a mapping to the GNU regex library but I couldn't even find a specification worth speaking of, it seemed to be a matter of trial and error to find out what worked.

    (1-1/1)

    Please register to reply