[bitflux-cms] passing parameters to xslt

Christian Stocker christian.stocker at bitflux.ch
Thu Jan 26 15:46:31 CET 2006


Hi

So this is now in SVN (trunk branch for both Flux CMS and Popoon).
The syntax is as following:

For .configxml of a collection:
***
<plugins>
  <parameter name="ar" key="foo" type="pipeline" value="foo_value"/>
  <parameter name="ar" key="bar" type="pipeline" value="foo_bar"/>
...
***

for sitemap.xml

***
<map:transform type="xslt" src="something">
   <map:parameter namevalues="{ar}"/>
...
***

This is the same as you would write in .configxml

 <parameter name="foo" type="pipeline" value="foo_value"/>
 <parameter name="bar" type="pipeline" value="foo_bar"/>

and and in sitemap.xml

  <map:parameter name="foo" value="{foo}"/>
  <map:parameter name="bar" value="{bar}"/>

Hope that helps

chregu


On 25.1.2006 11:24 Uhr, Christian Stocker wrote:
> 
> On 25.1.2006 11:00 Uhr, qMax wrote:
> 
>>Hi.
>>
>>I'm using my own pipeline like this:
>><map:when test="xmldoc">
>>   <map:include label="bxcmsGenerator"/>
>>   <map:transform type="xslt" src="{stylesheet}">
>>     <!-- some standard parameters here -->
>>   </map:transform>
>>   <map:include label="standardOutput"/>
>></map:when>
>>This pipeline is selected from my plugin xmldoc.
>>Stylesheet could be different for each resource, handled by plugin,
>>but usually common to collection.
>>
>>Now i want to pass _random_ (stylesheet dependant) parameters to this
>>stylesheet, configuring them in collection config for whole collection or some
>>particular resource (eg: section numbering, TOC generation, etc.)
>>
>>I can set up some parameters in .configxml:
>><plugin name="xmldoc">
>>  <parameter type="..." name="..." value="..."/>
>></plugin>
>>And theres a way to get them in plugin instance: $this->getParameter($this->getCurrentRequest('collUri'),$param_name,$param_type)
>>The question is - how to pass them to stylesheet ?
> 
> 
> Here's my proposal :) (that doesn't work yet, but shouldn't be too hard
> to be implemented)
> 
> for .configxml
> 
> <plugins>
>  <parameter key="param1" name="xsltparams" type="pipeline"
> value="somevalue"/>
>  <parameter key="param2" name="xsltparams" type="pipeline"
> value="someothervalue"/>
>   <plugin .....
>   </plugin>
> </plugins>
> 
> and in sitemap.xml
> 
>  <map:include label="bxcmsGenerator"/>
>     <map:transform type="xslt" src="{stylesheet}">
> 	<map:parameter multiple="true"  value="{xsltparams}"/>
>     </map:transform>
>  </map:include>
> 
> the first would make an array like:
> 
> $xsltparams = array("param1" => "somevalue", "param2" => "someothervalue");
> 
> and the sitemap would translate that as if it was written as
> 
> <map:parameter name="param1" value="somevalue"/>
> <map:parameter name="param2" value="someothervalue"/>
> 
> Would that help?
> 
> chregu
> 
> 
>>I guess i could take them right in stylesheet using php:functionString,
>>but dunno if plugin instance acessable there.
>>
> 
> 

-- 
christian stocker | Bitflux GmbH | schoeneggstrasse 5 | ch-8004 zurich
phone +41 44 240 56 70 | mobile +41 76 561 88 60 | fax +41 1 240 56 71
http://www.bitflux.ch | christian.stocker at bitflux.ch |  GPG 0x5CE1DECB


More information about the bitflux-cms mailing list