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