Re: [xsl] XSL Remove part of a text inside TAG

Subject: Re: [xsl] XSL Remove part of a text inside TAG
From: "Mukul Gandhi" <gandhi.mukul@xxxxxxxxx>
Date: Fri, 7 Mar 2008 22:42:46 +0530
To use exslt.org scripts in your code, you should not worry much about
how to package them in your stylesheet. The code available at
exslt.org is normal XSLT code, so you can just import that in your
stylesheet, or copy paste the code in the stylesheet.

Mentioning regarding your post below, you can't use the function,
fn:matches with XSLT 1.0. This is a XPath 2.0 function.

As you are attempting, you can write a recursive template for
tokenization functionality. I think, people on this thread have given
good advice on how to do this.

Happy XSLT programming :)

On Fri, Mar 7, 2008 at 8:58 AM, Buddhi D. Mahindarathne
<buddhi@xxxxxxxxxxxxxxxxxxx> wrote:
> Hi all,
>  I tried Mukul Gandhi's way, but it is not working for me. And I can't
> use other packages as he requested because I can't package and
> distribute those with my application. I have to use standard XSLT 1.0
>
> So, I implemented following ...
>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
>  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
>        <xsl:template match="/">
>                <xsl:apply-templates select="*"/>
>        </xsl:template>
>    <xsl:template match="@* | node()">
>        <xsl:copy>
>          <xsl:apply-templates select="@* | node()"/>
>        </xsl:copy>
>    </xsl:template>
>   <xsl:template match="VisualObject">
>                <xsl:choose>
>                        <xsl:when test="@xsi:type='CBarCode'">
>                                <xsl:copy>
>                                        <xsl:variable name="fontface"
> select = 'FontFace'/>
>                                        <xsl:call-template name="while">
>                                                <xsl:with-param
> name="foo" select="$fontface"/>
>                                        </xsl:call-template>
>                                </xsl:copy>
>                        </xsl:when>
>                        <xsl:otherwise>
>                                <xsl:copy-of select="."/>
>                        </xsl:otherwise>
>                </xsl:choose>
>        </xsl:template>
>
> <xsl:template name="while">
>        <xsl:param name="foo"/>
>        <xsl:choose>
>                <xsl:when test="fn:matches($foo ='\')">
>                        <xsl:variable name="newfoo"
> select="fn:substring-after($foo,'\')"/>
>                        <xsl:call-template name="while">
>                                <xsl:with-param name="foo"
> select="$newfoo"/>
>                        </xsl:call-template>
>                </xsl:when>
>                <xsl:otherwise>
>                        <xsl:value-of select="$foo"/>
>                </xsl:otherwise>
>        </xsl:choose>
> </xsl:template>
> </xsl:stylesheet>
>
> But, to use those string functions I need to add a another NameSpace
> xmlns:xsi="http://www.w3.org/2005/02/xpath-functions";
>
> Since I already have one how I put another one there...??
> Or any other ways of doing this... only with standard package..
>
> - Buddhi -


-- 
Regards,
Mukul Gandhi

Current Thread