cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Haul <h...@dvs1.informatik.tu-darmstadt.de>
Subject Re: Different stylesheets called on runtime?
Date Thu, 23 Jan 2003 17:14:44 GMT
On 23.Jan.2003 -- 05:42 PM, Johannes.Becker@o2.com wrote:
>      int whichXSL;
> 
>       String report_id = request.getParameter("report_id");
>       String service_id = request.getParameter("service_id");
>       String nbt_pattern_id = request.getParameter("nbt_pattern_id");
>       String search_txt = request.getParameter("search_txt");
>       ...
> 
>      // Check against a database, bla, bla
>      ...
> 
> 
>     // Now I want to choose the suitable XSL
>     if( whichXSL == 1)

Unfortunately, you've skipped the crucial part i.e. how the xsl is
chosen :-|

> ...
> <map:match pattern="differentXSLs">
>             <map:generate type="serverpages" src="differentXSLs.xsp"/>
>             <!-- if  "whichXSL == 1" -->
>             <!-- <map:transform src="number1.xsl"/>-->
>              <!-- if  "whichXSL == 2" -->
>             <!-- <map:transform src="number2.xsl"/>-->
>             <!-- if  "whichXSL == 3" -->
>             <!-- <map:transform src="number3.xsl"/>-->
>              ...
>             <map:serialize/>
> </map:match>
> ....
> 
> So how and where should I place my action (and how should it look like)?

around one transform and use a returned value as file name, e.g.

   <map:act type="sel-style">
      <map:transform src="{file}.xsl"/>
   </map>

> How should my xsp look like then?

rip out everything related to the XSL

> How should my xsl look like then?

no change.

	Chris.
-- 
C h r i s t i a n       H a u l
haul@informatik.tu-darmstadt.de
    fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>


Mime
View raw message