cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stefan Seifert" <sseif...@pro-vision.de>
Subject AW: C2 - Dynamically choose XSL-Template in XSP
Date Fri, 17 Aug 2001 15:41:26 GMT
Its a bit more complicated to do that in C2 - you have to make you own
action. 

Then you can use a sitemap construct like this:

    <map:match pattern="rs/rs_dok/0,,**,00.htm">
      <map:act type="RSDokumentAction">
        <map:parameter name="DokumentID" value="{1}"/>
        <map:generate type="serverpages" src="xsp/rs_dok.xsp"/>
        <map:transform src="{TemplateURL}"/>
        <map:serialize/>
      </map:act>
    </map:match>

were the Action "RSDokumentAction" returns a the Filename of the
Template (fetched from the Database), which is later used to transform
the document.

Stefan


> > This is my problem: With Cocoon 1 I created a XSP-Page, which builds
> > an XML-Stream using the ESQL TagLib from a Database. The 
> Path for the
> > XSL to use was also fetched from the database and applyed using the
> > following statement:
> >       <xsp:pi target="xml-stylesheet">
> >        href="<esql:get-string column="TemplateURL"/>"
> >         type="text/xsl"
> >       </xsp:pi>
> > Unfortunately this approach does not work with Cocoon2, where the
> > XSL-Transformation is defined in the pipeline-Definition. 
> How is this
> > possible to solve this with Cocoon2?
> 
> I've got the same problem. I would like to generate XML and dynamicly
> choose XSL to apply to this XML - I was try to use
> <?xml-stylesheet type="text/xsl" href="transform.xsl"?>
> but it just does not work. Cocoon2 just do not use any XSL or [is
> specified] use XSL specified in sitemap like this:
>    <map:match pattern="hello.html">
>     <map:generate src="hello.xml"/>
>   * <map:transform src="hello.xsl"/> *
>     <map:serialize type="html"/>
>    </map:match>
> 
> Have You found the solution ?
> It can't be impossible, I thing I have to switch some config option.
> 
> Thanks in advance.
> 
> -- 
> Marcin Caban   'Cabko'   http://cabko.anixe.org/

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.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