[lxml-dev] String parameters to xslt transformation
Stefan Behnel
stefan_ml at behnel.de
Fri Feb 6 19:52:51 CET 2009
Hi,
Alexander Shigin wrote:
> В Птн, 06/02/2009 в 17:14 +0100, Stefan Behnel пишет:
>> Thanks! That looks much better. I'll fix up a couple of things and check
>> if I can't get Cython to support classmethods for this purpose. If all
>> works out, I'll add it for 2.2.
>
> Oh, I totally forgot, but I think that ```XSLT.strparam``` is a bit
> strange for escaping method to be placed. It's only my point of view,
> but I prefer
> transform = etree.XSLT(...)
> result = transform(doc, string_var=etree.strparam("hi"))
> instead of
> result = transform(doc, string_var=transform.strparam("hi"))
I'm not sure. My thoughts were that the only purpose of that function will
be the use for XSLT string parameters, so you can either name it
"xsltstrparam()" or "xslt_string_parameter()", which sounds lengthy and
unwildy, or you can move it into a namespace that makes it clear what it
does, i.e. "XSLT.strparam()". That way, you can easily reference it in a
local variable if you prefer a function, but it keeps the functionality
local to its intrinsic scope.
Stefan
More information about the lxml-dev
mailing list