You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Eric Dalquist <eb...@mtu.edu> on 2002/07/09 19:56:10 UTC

QUESTION: Dynamic XSL

I was wondering if there is a way to generate an XSL document to be used in
another transformation. Here is an theoretical pipeline that might
illustrate my question a bit better:

<!--
Generate the dynamic page with it's specific style sheet and then apply the
site's format
-->
            <map:match pattern="*.xsp">
                <map:generate type="serverpages" src="logic/{1}.xsp"/>
                <map:transform src="site_format.xsl"/>
                <map:transform src="stylesheets/{1}.xsl"/>
                <map:serialize/>
            </map:match>

<!--
Generate the site format stylesheet so navigation data along with look and
feel data can be stored in a database
but only called from one spot.
-->
            <map:match pattern="site_format.xsl">
                <map:generate type="serverpages"
src="logic/site_format.xsp"/>
                <map:serialize/>
            </map:match>

I hope this makes sence to someone and they have some suggestions.

-Eric Dalquist


---------------------------------------------------------------------
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:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: QUESTION: Dynamic XSL

Posted by Eric Dalquist <eb...@mtu.edu>.
Thanks for the tip. It works great!

-Eric Dalquist

----- Original Message -----
From: "Koen Pellegrims" <ko...@pandora.be>
To: <co...@xml.apache.org>
Sent: Tuesday, July 09, 2002 2:21 PM
Subject: RE: QUESTION: Dynamic XSL


> Your idea is not as far-fetched as you might think (I think there is a
> sample with dynamically generated content *and* stylesheets).
> You will, however, need to use the cocoon:/ protocol in your sitemap to
> allow your .xsl to be machted by the appropriate pipeline:
>
> <map:match pattern="*.html">
> <map:generate type="serverpages" src="logic/pages/{1}.xsp"/>
> <map:transform src="cocoon:/{1}.xsl"/>
> <map:generate type="html"/>
> </map:match>
>
> <map:match pattern="*.xsl">
> <map:generate type="serverpages" src="logic/stylesheets/{1}.xsp"/>
> <map:serialize type="xml"/>
> </map:match>
>
> This example should do what you are looking for. The cocoon:/ protocol
tries
> to find an appropriate match in the
> current sitemap.
>
> Koen.
>
> -----Oorspronkelijk bericht-----
> Van: Eric Dalquist [mailto:ebdalqui@mtu.edu]
> Verzonden: dinsdag 9 juli 2002 19:56
> Aan: cocoon-users@xml.apache.org
> Onderwerp: QUESTION: Dynamic XSL
>
>
> I was wondering if there is a way to generate an XSL document to be used
in
> another transformation. Here is an theoretical pipeline that might
> illustrate my question a bit better:
>
> <!--
> Generate the dynamic page with it's specific style sheet and then apply
the
> site's format
> -->
>             <map:match pattern="*.xsp">
>                 <map:generate type="serverpages" src="logic/{1}.xsp"/>
>                 <map:transform src="site_format.xsl"/>
>                 <map:transform src="stylesheets/{1}.xsl"/>
>                 <map:serialize/>
>             </map:match>
>
> <!--
> Generate the site format stylesheet so navigation data along with look and
> feel data can be stored in a database
> but only called from one spot.
> -->
>             <map:match pattern="site_format.xsl">
>                 <map:generate type="serverpages"
> src="logic/site_format.xsp"/>
>                 <map:serialize/>
>             </map:match>
>
> I hope this makes sence to someone and they have some suggestions.
>
> -Eric Dalquist
>
>
> ---------------------------------------------------------------------
> 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:     <co...@xml.apache.org>
> For additional commands, e-mail:   <co...@xml.apache.org>
>
>
>
> ---------------------------------------------------------------------
> 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:     <co...@xml.apache.org>
> For additional commands, e-mail:   <co...@xml.apache.org>
>
>



---------------------------------------------------------------------
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:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


RE: QUESTION: Dynamic XSL

Posted by Conal Tuohy <co...@paradise.net.nz>.
Yes this is possible. I have used:

<map:transform src="cocoon:/.....

To apply a stylesheet defined by an xml-stylesheet processing-instruction in
the source document. There will be a message from me about it in the archive
if you want to find it.

Con

> -----Original Message-----
> From: Koen Pellegrims [mailto:koen.pellegrims@pandora.be]
> Sent: Wednesday, 10 July 2002 06:22
> To: cocoon-users@xml.apache.org
> Subject: RE: QUESTION: Dynamic XSL
>
>
> Your idea is not as far-fetched as you might think (I think there is a
> sample with dynamically generated content *and* stylesheets).
> You will, however, need to use the cocoon:/ protocol in your
> sitemap to
> allow your .xsl to be machted by the appropriate pipeline:
>
> <map:match pattern="*.html">
> 	<map:generate type="serverpages" src="logic/pages/{1}.xsp"/>
> 	<map:transform src="cocoon:/{1}.xsl"/>
> 	<map:generate type="html"/>
> </map:match>
>
> <map:match pattern="*.xsl">
> 	<map:generate type="serverpages"
> src="logic/stylesheets/{1}.xsp"/>
> 	<map:serialize type="xml"/>
> </map:match>
>
> This example should do what you are looking for. The cocoon:/
> protocol tries
> to find an appropriate match in the
> current sitemap.
>
> Koen.
>
> -----Oorspronkelijk bericht-----
> Van: Eric Dalquist [mailto:ebdalqui@mtu.edu]
> Verzonden: dinsdag 9 juli 2002 19:56
> Aan: cocoon-users@xml.apache.org
> Onderwerp: QUESTION: Dynamic XSL
>
>
> I was wondering if there is a way to generate an XSL document
> to be used in
> another transformation. Here is an theoretical pipeline that might
> illustrate my question a bit better:
>
> <!--
> Generate the dynamic page with it's specific style sheet and
> then apply the
> site's format
> -->
>             <map:match pattern="*.xsp">
>                 <map:generate type="serverpages" src="logic/{1}.xsp"/>
>                 <map:transform src="site_format.xsl"/>
>                 <map:transform src="stylesheets/{1}.xsl"/>
>                 <map:serialize/>
>             </map:match>
>
> <!--
> Generate the site format stylesheet so navigation data along
> with look and
> feel data can be stored in a database
> but only called from one spot.
> -->
>             <map:match pattern="site_format.xsl">
>                 <map:generate type="serverpages"
> src="logic/site_format.xsp"/>
>                 <map:serialize/>
>             </map:match>
>
> I hope this makes sence to someone and they have some suggestions.
>
> -Eric Dalquist
>
>
> ---------------------------------------------------------------------
> 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:     <co...@xml.apache.org>
> For additional commands, e-mail:   <co...@xml.apache.org>
>
>
>
> ---------------------------------------------------------------------
> 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:     <co...@xml.apache.org>
> For additional commands, e-mail:   <co...@xml.apache.org>
>
>


---------------------------------------------------------------------
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:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


RE: QUESTION: Dynamic XSL

Posted by Koen Pellegrims <ko...@pandora.be>.
Your idea is not as far-fetched as you might think (I think there is a
sample with dynamically generated content *and* stylesheets).
You will, however, need to use the cocoon:/ protocol in your sitemap to
allow your .xsl to be machted by the appropriate pipeline:

<map:match pattern="*.html">
	<map:generate type="serverpages" src="logic/pages/{1}.xsp"/>
	<map:transform src="cocoon:/{1}.xsl"/>
	<map:generate type="html"/>
</map:match>

<map:match pattern="*.xsl">
	<map:generate type="serverpages" src="logic/stylesheets/{1}.xsp"/>
	<map:serialize type="xml"/>
</map:match>

This example should do what you are looking for. The cocoon:/ protocol tries
to find an appropriate match in the
current sitemap.

Koen.

-----Oorspronkelijk bericht-----
Van: Eric Dalquist [mailto:ebdalqui@mtu.edu]
Verzonden: dinsdag 9 juli 2002 19:56
Aan: cocoon-users@xml.apache.org
Onderwerp: QUESTION: Dynamic XSL


I was wondering if there is a way to generate an XSL document to be used in
another transformation. Here is an theoretical pipeline that might
illustrate my question a bit better:

<!--
Generate the dynamic page with it's specific style sheet and then apply the
site's format
-->
            <map:match pattern="*.xsp">
                <map:generate type="serverpages" src="logic/{1}.xsp"/>
                <map:transform src="site_format.xsl"/>
                <map:transform src="stylesheets/{1}.xsl"/>
                <map:serialize/>
            </map:match>

<!--
Generate the site format stylesheet so navigation data along with look and
feel data can be stored in a database
but only called from one spot.
-->
            <map:match pattern="site_format.xsl">
                <map:generate type="serverpages"
src="logic/site_format.xsp"/>
                <map:serialize/>
            </map:match>

I hope this makes sence to someone and they have some suggestions.

-Eric Dalquist


---------------------------------------------------------------------
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:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>



---------------------------------------------------------------------
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:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>