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

Re: xslt function

Subject: Re: xslt function
From: "Mukul Gandhi" <gandhi.mukul@xxxxxxxxx>
Date: Tue, 9 Sep 2008 12:47:45 +0530
Re:  xslt function
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"/>
<xsl:sequence
            select="if ($number=0) then 1 else $number *
my:factorial($number-1)"/>

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 http://www.w3schools.com/xsl/ but couldn't find
> anything like that.


-- 
Regards,
Mukul Gandhi

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.