[lxml-dev] Does lxml/libxslt support passing in nodes as xsl:param parameters?

Stefan Behnel stefan_ml at behnel.de
Sat Jul 19 20:52:12 CEST 2008


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

Stefan



More information about the lxml-dev mailing list