Subject: RE: [xsl] Let's face it: side effects are sometimes necessary! From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx> Date: Tue, 3 Dec 2002 11:01:04 -0000 |
> > I used to use <xsl:variable ...> elements on the toplevel of > an XSLT transform for their side-effects. The > xsl:variable/@select would call into some extension function, > that would set up some static data (initializations) of some gizmo. At the top level of the stylesheet, surely it's much easier to declare xsl:param's and supply the initial value from the calling application? > > I am thinking of: > > <xsl:variable name="gizmo" saxon:eval-immediately="yes" > xmlns:g="java:my.package.Gizmo" > select="g:new($gizmoInitializationParameter)"/> > If you specify saxon:assignable="yes", the variable will be evaluated whether or not it is referenced (except in the case of global variables that are overridden by another of higher precedence). One reasonably reliable way to force any XSLT processor to evaluate your extension functions is to make the function return an empty string, and call the function in an <xsl:value-of/>. The system can't possibly know that it will return an empty string, so it has to call the function; and moreover, it's very unlikely that it will call it out-of-sequence, because it has to put the results together in the right order. Michael Kay Software AG home: Michael.H.Kay@xxxxxxxxxxxx work: Michael.Kay@xxxxxxxxxxxxxx XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Let's face it: side effec, David Carlisle | Thread | RE: [xsl] Let's face it: side effec, Dion Houston |
[xsl] Unicode Reference in XSLT, Jan Mendling | Date | RE: [xsl] Unicode Reference in XSLT, Yates, Danny (ANTS) |
Month |