You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Leszek Gawron <ou...@wlkp.org> on 2003/11/18 10:34:17 UTC

access input modules from stylesheet

Is there a way to acces input modules nicely from xslt stylesheet? Right now I
am doing something like: 

<map:transform src="cocoon://{global:baseURL}/stylesheets/site2html.xsl">
				<map:parameter name="baseURL" value="/{global:baseURL}"/>
				<map:parameter name="appTitle" value="{global:appTitle}"/>
</map:transfrom>

this is all fine if one has only one sitemap (one can use resources to work
with duplicated code) but I have a web application that each app menu option
(application section) has it's own sitemap.

The number of parameters passed to stylesheets gets bigger and bigger with
time which makes the code harder to read and maintain.
	lg


-- 
            __
         | /  \ |        Leszek Gawron            //  \\
        \_\\  //_/       ouzo@wlkp.org           _\\()//_
         .'/()\'.     Phone: +48(501)720812     / //  \\ \
          \\  //  recursive: adj; see recursive  | \__/ |


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


Re: access input modules from stylesheet

Posted by Leszek Gawron <ou...@wlkp.org>.
On Tue, Nov 18, 2003 at 04:31:20AM -0600, Antonio Gallardo wrote:
> Hi Leszek:
> 
> Hmm.. Try better xinclude. That way you can store this unique application
> stuff in a separated xml file. And access it using xpath.
> 
> I prefer xinclude because then we can share resource between application
> and we know nothing will be broken.
I see two problems here:
1. performance
2. I do a lot of aggregations - the verbosity would kill me

The best situation would be if I could use some technique in stylesheets that
do not need to specify explicitly the list of parameters (some hash map
maybe?). In stylesheet code I would be able to query for specified parameter.

Second thing would be to make this hash map understand sitemap context so you
can change the values basing on current sitemap you're in (or use the parent's
default value). Imagine your site2html.xsl uses a parameter $appContextTitle
that changes depending on which sitemap you're in (each sitemap is another
application "component" )
	ouzo
-- 
            __
         | /  \ |        Leszek Gawron            //  \\
        \_\\  //_/       ouzo@wlkp.org           _\\()//_
         .'/()\'.     Phone: +48(501)720812     / //  \\ \
          \\  //  recursive: adj; see recursive  | \__/ |


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


Re: access input modules from stylesheet

Posted by Antonio Gallardo <ag...@agsoftware.dnsalias.com>.
Hi Leszek:

Hmm.. Try better xinclude. That way you can store this unique application
stuff in a separated xml file. And access it using xpath.

I prefer xinclude because then we can share resource between application
and we know nothing will be broken.

Examples of that you can find in the cocoon samples.

Best Regards,

Antonio Gallardo

Leszek Gawron dijo:
> Is there a way to acces input modules nicely from xslt stylesheet? Right
> now I
> am doing something like:
>
> <map:transform src="cocoon://{global:baseURL}/stylesheets/site2html.xsl">
> 				<map:parameter name="baseURL" value="/{global:baseURL}"/>
> 				<map:parameter name="appTitle" value="{global:appTitle}"/>
> </map:transfrom>
>
> this is all fine if one has only one sitemap (one can use resources to
> work
> with duplicated code) but I have a web application that each app menu
> option
> (application section) has it's own sitemap.
>
> The number of parameters passed to stylesheets gets bigger and bigger with
> time which makes the code harder to read and maintain.
> 	lg
>
>
> --
>             __
>          | /  \ |        Leszek Gawron            //  \\
>         \_\\  //_/       ouzo@wlkp.org           _\\()//_
>          .'/()\'.     Phone: +48(501)720812     / //  \\ \
>           \\  //  recursive: adj; see recursive  | \__/ |
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>


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