[lxml-dev] XSLT parameter ignored?
Hello, I'm trying to pass a parameter to an XSLT object as follows: xslt = etree.parse(stylesheet) style = etree.XSLT(xslt) params = {'profile.lang': 'en'} result = style(doc, params) The stylesheet is applied, but the parameter is ignored. This works in libxslt, so what am I missing? TIA, Jeroen -- -- Jeroen van Holst <jeroen@xos.nl> -- X/OS Experts in Open Systems BV | Phone: +31 20 6938364 -- Amsterdam, The Netherlands | Fax: +31 20 6948204
Hi, Jeroen van Holst wrote:
I'm trying to pass a parameter to an XSLT object as follows:
xslt = etree.parse(stylesheet) style = etree.XSLT(xslt) params = {'profile.lang': 'en'} result = style(doc, params)
The stylesheet is applied, but the parameter is ignored. This works in libxslt, so what am I missing?
One thing you're missing is that lxml is not libxslt. It has a different API. Have you tried result = style(doc, **params) ? Stefan
Hi Stefan, Stefan Behnel wrote:
One thing you're missing is that lxml is not libxslt. It has a different API.
Have you tried
result = style(doc, **params)
I realize it's different, but wrongly expected the functional equivalent for passing parameters that can't be specified via name = value. Thanks for your suggestion, it works! -- -- Jeroen van Holst <jeroen@xos.nl> -- X/OS Experts in Open Systems BV | Phone: +31 20 6938364 -- Amsterdam, The Netherlands | Fax: +31 20 6948204
participants (2)
-
Jeroen van Holst -
Stefan Behnel