You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by David Crossley <cr...@apache.org> on 2005/04/11 03:36:36 UTC
suite of helper xsl templates (Was: svn commit: r160775)
Thorsten Scherler wrote:
> > Author: crossley
> > Date: Sun Apr 10 07:06:29 2005
> > New Revision: 160775
> >
> > URL: http://svn.apache.org/viewcvs?view=rev&rev=160775
> > Log:
> > Enable changes.html and todo.html to also be in subdirectories.
> > Use relative location of images directory obtained via dotdots template.
> ...
>
> >
> > Modified: forrest/trunk/plugins/org.apache.forrest.plugin.projectInfo/resources/stylesheets/changes2document.xsl
> > URL: http://svn.apache.org/viewcvs/forrest/trunk/plugins/org.apache.forrest.plugin.projectInfo/resources/stylesheets/changes2document.xsl?view=diff&r1=160774&r2=160775
> > ==============================================================================
> > --- forrest/trunk/plugins/org.apache.forrest.plugin.projectInfo/resources/stylesheets/changes2document.xsl (original)
> > +++ forrest/trunk/plugins/org.apache.forrest.plugin.projectInfo/resources/stylesheets/changes2document.xsl Sun Apr 10 07:06:29 2005
> > @@ -20,6 +20,16 @@
> > xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> > version="1.0">
> >
> > + <xsl:param name="path"/>
> > + <xsl:include href="dotdots.xsl"/> <!-- FIXME: howto include from forrest core -->
>
> I defined it in the viewHelper output.xmap like
> <map:match pattern="dotdots">
> <map:generate src="{forrest:context}/skins/common/xslt/html/dotdots.xsl"/>
> <map:serialize type="xml"/>
> </map:match>
>
> http://svn.apache.org/viewcvs.cgi/forrest/trunk/plugins/org.apache.forrest.plugin.viewHelper/output.xmap?view=markup
>
> ...and then using it in prepare.xhtml.xsl like
> <alias:import href="cocoon://dotdots"/>
>
> http://svn.apache.org/viewcvs.cgi/forrest/trunk/plugins/org.apache.forrest.plugin.view/resources/stylesheets/prepare.xhtml.xsl?view=markup
>
> Maybe we should declare the common helper stylesheets in the core and
> this way could use them in the plugins.
Yes, i noticed what you did while i was preparing my patch.
However, i have never seen this use of
<alias:import href="cocoon://..."/>
so i did my quick fix until i can get my head around it.
Yes i reckon that we should have some method for a library
of helper xsl templates.
--David
Re: suite of helper xsl templates (Was: svn commit: r160775)
Posted by Ross Gardler <rg...@apache.org>.
Thorsten Scherler wrote:
> On Mon, 2005-04-11 at 11:36 +1000, David Crossley wrote:
>
>>>I defined it in the viewHelper output.xmap like
>>><map:match pattern="dotdots">
>>> <map:generate src="{forrest:context}/skins/common/xslt/html/dotdots.xsl"/>
>>> <map:serialize type="xml"/>
>>></map:match>
>>>
>>>http://svn.apache.org/viewcvs.cgi/forrest/trunk/plugins/org.apache.forrest.plugin.viewHelper/output.xmap?view=markup
>>>
>>>...and then using it in prepare.xhtml.xsl like
>>><alias:import href="cocoon://dotdots"/>
>>>
>>>http://svn.apache.org/viewcvs.cgi/forrest/trunk/plugins/org.apache.forrest.plugin.view/resources/stylesheets/prepare.xhtml.xsl?view=markup
>>>
>>>Maybe we should declare the common helper stylesheets in the core and
>>>this way could use them in the plugins.
>>
>>Yes, i noticed what you did while i was preparing my patch.
>>However, i have never seen this use of
>><alias:import href="cocoon://..."/>
>>so i did my quick fix until i can get my head around it.
>>
>
>
> :)
>
> <alias:import/> will result in a dynamic import. The solution that we
> have right now (regarding view/viewHelper) will generate dynamically the
> xsl for the final step of the transformation.
>
> ...xmlns:alias="http://www.w3.org/1999/XSL/TransformAlias">
> <xsl:namespace-alias stylesheet-prefix="alias" result-prefix="xsl"/>
>
> Here we switching namespaces for the resulting alias:*. The result is xsl but with alias as namespace.
>
> I implemented it like this because I thought is more effective to define
> the templates I need for the transformation before. This way I will have
> always only a subset of templates.
>
> ...but the drawback is that we do not know whether those pipes will be
> cached by cocoon. I am thinking about a java class to get the templates,
> store them in a JavaBean and then generating the final aggregated
> stylesheet (that only contains "needed" templates) out of the javaBeans
> but I reckon that we can discuss after 0.7 release.
>
>
>>Yes i reckon that we should have some method for a library
>>of helper xsl templates.
>>
>
>
> +1 That should be valid for the copyless approach. This way the usage of
> the core xsl helper templates will be more effective in plugins.
+1 This looks good.
Ross
Re: suite of helper xsl templates (Was: svn commit: r160775)
Posted by Thorsten Scherler <th...@apache.org>.
On Mon, 2005-04-11 at 11:36 +1000, David Crossley wrote:
> > I defined it in the viewHelper output.xmap like
> > <map:match pattern="dotdots">
> > <map:generate src="{forrest:context}/skins/common/xslt/html/dotdots.xsl"/>
> > <map:serialize type="xml"/>
> > </map:match>
> >
> > http://svn.apache.org/viewcvs.cgi/forrest/trunk/plugins/org.apache.forrest.plugin.viewHelper/output.xmap?view=markup
> >
> > ...and then using it in prepare.xhtml.xsl like
> > <alias:import href="cocoon://dotdots"/>
> >
> > http://svn.apache.org/viewcvs.cgi/forrest/trunk/plugins/org.apache.forrest.plugin.view/resources/stylesheets/prepare.xhtml.xsl?view=markup
> >
> > Maybe we should declare the common helper stylesheets in the core and
> > this way could use them in the plugins.
>
> Yes, i noticed what you did while i was preparing my patch.
> However, i have never seen this use of
> <alias:import href="cocoon://..."/>
> so i did my quick fix until i can get my head around it.
>
:)
<alias:import/> will result in a dynamic import. The solution that we
have right now (regarding view/viewHelper) will generate dynamically the
xsl for the final step of the transformation.
...xmlns:alias="http://www.w3.org/1999/XSL/TransformAlias">
<xsl:namespace-alias stylesheet-prefix="alias" result-prefix="xsl"/>
Here we switching namespaces for the resulting alias:*. The result is xsl but with alias as namespace.
I implemented it like this because I thought is more effective to define
the templates I need for the transformation before. This way I will have
always only a subset of templates.
...but the drawback is that we do not know whether those pipes will be
cached by cocoon. I am thinking about a java class to get the templates,
store them in a JavaBean and then generating the final aggregated
stylesheet (that only contains "needed" templates) out of the javaBeans
but I reckon that we can discuss after 0.7 release.
> Yes i reckon that we should have some method for a library
> of helper xsl templates.
>
+1 That should be valid for the copyless approach. This way the usage of
the core xsl helper templates will be more effective in plugins.
> --David
--
thorsten
"Together we stand, divided we fall!"
Hey you (Pink Floyd)