[lxml-dev] Does lxml/libxslt support passing in nodes as xsl:param parameters?
Paul Everitt
paul at agendaless.com
Sat Jul 19 23:32:39 CEST 2008
On Jul 19, 2008, at 2:52 PM, Stefan Behnel wrote:
> Hi,
>
> Paul Everitt wrote:
>> I believe the answer is no. I can't tell if this is part of the
>> spec,
>> but docs on other processors imply that you can use a node or node
>> list
>> as the value of a parameter passed to a transformation.
>>
>> In my use case, I'm trying to get information from the current web
>> request. I don't want to modify the input document (my normal way
>> to do
>> this.) Thus, an XPath extension function or a document resolver will
>> have to serve the purpose.
>
> XSLT parameters are passed as strings (char*), so passing subtrees
> will not
> work. Passing an XPath expression will work, though, so you can at
> least refer
> to all sorts of things that exist in the current context.
>
> But have you looked at XSLT extension elements? They might do what
> you want.
>
> http://codespeak.net/lxml/extensions.html#xslt-extension-elements
My challenge is getting at data that was in scope at the time I ran
the transformation. The extension element won't have access to that
information. I'll be in a threaded environment (WSGI request), so
I'll need to arrange to stash the data away in a thread local, then
grab it from within the extension element.
Or??
--Paul
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://codespeak.net/pipermail/lxml-dev/attachments/20080719/d3feb301/attachment-0001.htm
More information about the lxml-dev
mailing list