cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sudheendra Hebbagilu <sudheen...@insage.com>
Subject RE: XSL selection by GET request
Date Tue, 23 Jan 2001 18:10:43 GMT
Hi... 
This is how I select one of the stylesheet depending on a parameter. If this
is what u r looking for 
---------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<?cocoon-process type="xsp"?>
<xsp:page language="java" xmlns:xsp="http://www.apache.org/1999/XSP/Core">
<PAGE>
<xsp:logic>
String file = &quot;/datasheet/pdf.xsl&quot;;
String param = null;
param = (String)request.getParameter(&quot;type&quot;);
if (param != null &amp;&amp; !param.equals(&quot;&quot;)){
      file = &quot;/datasheet/html.xsl&quot;;
}
</xsp:logic>
<xsp:pi target="cocoon-process">type=&quot;xslt&quot;</xsp:pi>
<xsp:pi target="xml-stylesheet">href=&quot;<xsp:expr>file</xsp:expr>&quot;
type=&quot;text/xsl&quot;</xsp:pi>

...........................
--------------------------------------------
Depending on a url parameter called type , I select one of the stylesheet.

HTH
Sudhi

> 
> how do I get the same XML document either as a HTML page
> or PDF file using a parameter in the GET request?
> 

Mime
View raw message