Maybe you could use
<xsl:sequence select="my:add()">
Since an empty sequence is generated by your function, xsl:sequence generates an empty sequence, and the output is left unchanged.

2013/11/22 Steve Carton <>
I have a java XSLT extension function which I need to call to update certain state information. It has no return (public void add(...))

How do I make a call to this function? Since it isn't returning anything, it makes no sense to put it in an xsl:value-of. I tried assigning it to a variable, but it looks like variables don't actually get created until they are being used? The only way I got this to work was to then emit the (empty) variable in a comment in the output. But I don't need a bunch of empty comments in the output.

Is there another way in either Saxon or XSLT 2 in general to accomplish this? Is there a trick to make the extension function call at the time of variable assignment instead of use?

Steve   Carton

Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing
conversations that shape the rapidly evolving mobile landscape. Sign up now.
saxon-help mailing list archived at

Envoyé depuis Firefox et analysé grâce à Hadoop par la NSA (via Gmail©®™) 😏