[lxml-dev] How to access XSLT Parameters Inside an Extension Function?

Stefan Behnel stefan_ml at behnel.de
Tue Jun 10 20:41:58 CEST 2008


Hi,

Thomas Schraitle wrote:
> On Dienstag, 10. Juni 2008, Stefan Behnel wrote:
>> Thomas Schraitle wrote:
>>> Let's say I have a couple of parameters in my XSLT file. How can I
>>> access them in my extension function?
>> You can't. Any reason why you are not just passing them into the
>> function?
> 
> Let me explain my confusion a bit: For example, you have an extension 
> function foo:
> 
>   def foo(_):
>     return True

Why not

    def foo(_, a, b, c): ...

Then you take your XSLT parameter, say "$param" and call your function like this:

    <xsl:value-of select="foo(1, 2, $param)"/>

Stefan



More information about the lxml-dev mailing list