How to call XSLT templates inline? For instance, instead of :
<xsl:call-template name="myTemplate" >
<xsl:with-param name="param1" select="'val'" />
</xsl:call-template>
Can I use XSLT built-in function-call style, like this:
<xls:value-of select="myTeplate(param1)" />
The syntax of XSLT is correct in the first example. You could also write
I am not sure what you are trying to do in the second code snippet (the 'val' is missing and there are two typos (xls, and myTeplate)) but it is not valid XSLT.I n
UPDATE If I now understand your question it was not "is there an alternative syntax for XSLT templates?" but "can I write my own functions in XSLT?".
Yes, you can. Here is a useful introduction. Note that you have to provide your Java code in a library and this may not be easy to distribute (e.g. in a browser). Try http://www.xml.com/pub/a/2003/09/03/trxml.html