Here's one way:

See the "Meta-Stylesheets" page on the Wiki.
http://outerthought.net/wiki/Wiki.jsp?page=MetaStylesheets

I assume that the article contains a PI or similar, pointing to the
stylesheet the author wants to use? You can transform the document using an
XSLT that is generated by another pipeline. This XSLT is generated by
transforming the content document (by extracting and resolving the URL
inside the PI in the document) into the stylesheet to which it refers.

match pattern="dynamic-xslt/*.xsl"
        generate src="{1}.html"
        transform src="convert-pi-to-xinclude.xsl"
        transform type="xinclude"
        serialize type="xml"

match pattern="article/*.html"
        generate src="{1}.html"
        transform src="cocoon:/dynamic-xslt/{1}.xsl"
        serialize type="xml"

Cheers!

Con


> -----Original Message-----
> From: Robert Sösemann [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, 4 December 2002 05:31
> To: [EMAIL PROTECTED]
> Subject: dynamic atylesheet assignment
>
>
> I am working on a news site, where every author can assign own xsl
> stylesheet to their article. I want to bring cocoon
> dynamically insert an
> article's path into the transformer src attribute.
>
> I thought of generating an parameter inside the xsp for the following
> components an later catch it by the transformer. (How) can I do this?
>
>             <map:match pattern="**article_*.html">
>                 <map:act type="url-extract">^
>
>                     <!-- Inside the generate the path info is
> extracted from
> db -->
>                     <map:generate
> src="logicsheets/get-articledata.xsp"
> type="xsp">
>                         <map:parameter name="article-id"
> value="{../2}"/>
>                     </map:generate>
>                 </map:act>
>
>                 <map:transform
> src="transform/style-frame.xsl" type="xslt"/>
>
>                 <!-- here I want to access the path info -->
>                 <map:transform src="transform/{dynamic-path}"
> type="xslt"/>
>
>                 <map:transform src="transform/style-footer.xsl"
> type="xslt"/>
>                 <map:serialize type="html"/>
>             </map:match>


---------------------------------------------------------------------
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:     <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>

Reply via email to