|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Treat any template as a function
I am using the EXSLT Function module a lot. But, I'm wondering why it is
necessary. Why can't XSLT processors allow users to call templates using
normal function notation. Is this something that is planned for XSLT
2.0? Personally, I don't see any obvious value in distinguishing between
functions and templates (a template is just a function that returns an
RTF, and an RTF is just a special type of node-set).
For example, the following two stylesheet fragments should, IMO, be equivilent, given a template like this: ... <xsl:template name='bls:my-template'> <xsl:param name='param1'/> <xsl:param name='param2'/> </xsl:template> ... (1)
...
<xsl:variable name='var'>
<xsl:call-template name='bls:my-template'>
<xsl:with-param name='param1' select='...'/>
<xsl:with-param name='param2' select='...'/>
</xsl:call-template>
</xsl:variable>
<xsl:value-of select='$var/*'/>
...
(2):
...
<xsl:value-of select='bls:my-template(param1, param2)'/>
...Along similar lines, has anybody written a stylesheet that can do these transformations on a stylesheet: 1. Transform all named templates (without match patterns) into EXSLT functions? 2. Transform all <call-template> elements that call these functions into <xsl:value-of> elements that cal them? Thanks, Brian XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








