[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: xalan and replace "regex"

Subject: Re: xalan and replace "regex"
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Fri, 28 Dec 2007 09:19:44 +0100
Re:  xalan and replace "regex"
Mansour wrote:
Matthew, I have checked this and when it nothing worked for me, I decided to post to this list.
A simple sheet to test how would replace work :


<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xalan="http://xml.apache.org/xalan" xmlns:str="http://exslt.org/strings">
<xsl:import href="str/str.xsl" />


   <xsl:template match="program">
       <xsl:call-template name="str:replace">
           <xsl:with-param name="string" select="." />
           <xsl:with-param name="search" select="public" />
           <xsl:with-param name="replace" select="object" />
       </xsl:call-template>
   </xsl:template>

</xsl:stylesheet>


This did not help and nothing changed in the output. This is why I am considering another solution.

Because you do not have that template installed, perhaps?
Instead, if you want to use this, you should call it as str:replace(., public, object). However, this replace function does not support regular expressions. Instead, you can also consider regexp:replace(), which is explained here: http://www.exslt.org/regexp/functions/replace/regexp.replace.html. But I don't know whether your processor supports it.


Still, it will be quite far from the functionality you would gain when moving to XSLT 2.0. But Michael Kay has already elaborated on that subject and how you can tackle that.

Cheers,
-- Abel Braaksma

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.