Subject: RE: [xsl] Functional programming in XSLT (revised) From: "Michael Kay" <mhkay@xxxxxxxxxxxx> Date: Fri, 16 Mar 2001 16:59:39 -0000 |
> > Having said that, I made saxon:function available at the top-level > > only, because I didn't want to spend the rest of my life explaining > > the concept of local functions, and juistifying why they should have > > access to local variables declared outside the function body. > > Would you mind doing it just once? I hadn't really considered the > possibility of local exsl:function before, and would like to > understand what its implications would be if we were to introduce it. Consider the knight's tour and the code on page 622 of XSLT Prog Ref. A local function here f($a, $b, $diff) would allow this to be written as <xsl:if test="f(1, 0, -17)"> ... </xsl:if> <xsl:if test="f(1, 7, -15)"> ... </xslif> etc, saving a lot of repetitive coding, and meaning that only one place has to change rather than 8 when the logic changes. A global function here is little use, because it doesn't have access to the local variables. Mike Kay Software AG XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Functional programming in, Jeni Tennison | Thread | Re: [xsl] Functional programming in, Alexey Gokhberg |
Re: [xsl] Functional programming in, David Rosenborg | Date | [exsl] Naming exsl:return/exsl:resu, Jeni Tennison |
Month |