cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael French <mfre...@zycor.lgc.com>
Subject Passing parameters to XSL processor
Date Thu, 16 Dec 1999 15:10:26 GMT

Is there any way to pass request parameters to an XSL processor ?

The kinds of things I have in mind are mappings to
xsl:variable, xsl:import and xsl:include, so that filtering,
matching and styling can be dynamic.

Looking at the code (for the first time) I see the params are
passed down to the process() and getStylesheet() methods, 
so it should be possible to add top-level nodes to the stylesheet 
in a generic (DOM) way, perhaps in AbstractXSLTProcessor.
(or perhaps there are processor-specific init calls which bypass 
XSL DOM and write straight to the internal data structures).

There are caching issues, but the cache could be left unchanged, 
with init happening on-the-fly somewhere between getStylesheet()
and process().

A more general and elegant approach would be to copy the pattern
from SQLQueryCreator, and have a class which gets called with the
XSL document and the parameters, and it can add any top-level nodes
(or do anything else for that matter).

Another interesting approach is to make the stylesheet dynamically
generated (through a custom producer), but in that case there's no
obvious way to chain the orginal request parameters into the nested
stylesheet linking request.

Mike
  

Mime
View raw message