Altova Mailing List Archives

Re: [xsl] xslt function

From: "Mukul Gandhi" <gandhi.mukul@--------->
Date: 9/9/2008 7:18:00 AM
With XSLT 2.0, this is available natively.

Here is one example taken from Saxon docs

<xsl:function name="my:factorial" as="xs:integer">
<xsl:param name="number" as="xs:integer"/>
            select="if ($number=0) then 1 else $number *

With XSLT 1.0 (and also 2.0), you can use named templates to simulate
what functions need to do.

With XSLT 2.0, you will get much better data typing than XSLT 1.0.

On Tue, Sep 9, 2008 at 9:32 AM, Mohit Anchlia <mohitanchlia@xxxxxxxxx> wrote:
> Is it possible to write a function in xslt. I need to write a function
> so that I can change the text value of a given node if it matches
> certain criteria. Could somebody give me some example of how to do
> that. I looked at but couldn't find
> anything like that.

Mukul Gandhi


These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.