[lxml-dev] Transform parameter variables
I can get transform to accept literal parameter. eg.
transform = etree.XSLT(xsl_tree) result = transform(xml_tree, area="'xxx'")
*But I can't get transform to accept variables!!?* I have tried: - param = "area=\"\'xxx\'\"" - result = transform(xml_tree, param) - result = apply(transform(xml_tree,param)) I have altso tried to send parameter as dictionary (as I want to send more parameters than one). What am I doing wrong? -- Regards. Niels Bjerre
Hi, Niels Bjerre wrote:
I can get transform to accept literal parameter. eg.
transform = etree.XSLT(xsl_tree) result = transform(xml_tree, area="'xxx'")
*But I can't get transform to accept variables!!?*
I have tried:
- param = "area=\"\'xxx\'\"" - result = transform(xml_tree, param) - result = apply(transform(xml_tree,param))
I have altso tried to send parameter as dictionary (as I want to send more parameters than one).
You can pass more than one kayword parameter, as everywhere in Python. If you want to pass them from a dictionary, do the usual result = transform(xml_tree, **the_dict) trick. Stefan
participants (2)
-
Niels Bjerre
-
Stefan Behnel