Re: [Zopexmlmethods-devel] Override variable definitions via query string?
Brought to you by:
arielpartners,
philikon
|
From: Philipp v. W. <ph...@we...> - 2003-05-19 09:59:10
|
Hi Craeg,
> But for official project documents, we _do_ want a table of contents.
> Here, in my naivete, is that I tried to do inside my page template:
>
> <div tal:define="doc nocall:python:folder[docname]" >
nocall:python: is overhead. Simply do
<div tal:define="doc python:folder[docname]">
> <div tal:replace="structure doc/articlexsl?toc='yes'"/>
tales does not allow URL syntax. You will have to call it using a python
expression:
<div tal:replace="structure python:doc.articlexsl(toc='yes')">
Now, that's the way you'd want it to work. It won't work unfortunately,
because XSLTMethod.__call__ really wants a request (and so does the
transform method) and does not accept keyword arguments. That is bad!
Looking at the code, XSL parameters really come from getXSLParameters()
which simply acquires 'XSLparameters'. As it seems, there is no way of
passing XSL parameters dynamically. Even worse!
As mentioned above, you'd really like to pass a parameters as a keyword
argument to __call__, wouldn't you?
Why not make __call__ accept arbitrary keyword arguments (**kw)? Also,
is there any good reason not to expose all request variables to the
transformation? This way, you can have meaningful URLs like
http://aXMLsource/aXSLTMethod?output=html
http://aXMLsource/aXSLTMethod?output=text
where as the output variable will be available in the XSLT code as a
parameter.
IMO, the change would be rather trivial and would not necessarily break
backward compatability (though I would like to get rid of this icky
'XSLparameters' acquisition).
Thoughts,
Phil
|