xsl-list
[Top] [All Lists]

Re: [xsl] Reusing and XPath expression

2011-03-03 06:05:32
Jacobus Reyneke wrote:

In this example I resize the section titles in FO depending on the
depth of the title. Is there some way I can put the
"count(ancestor::*)" expression in one place and so re-use it in
different templates by 'calling' it? I cannot just make the expression
'global' because new values cannot be assigned to it.

'calling it' sounds as if you want to define a function, in XSLT 2.0 you can do that with xsl:function http://www.w3.org/TR/xslt20/#stylesheet-functions, in XSLT 1.0 some processors support an extension element for that functionality.

--

        Martin Honnen
        http://msmvps.com/blogs/martin_honnen/

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>