You are viewing a plain text version of this content. The canonical link for it is here.
Posted to svn@forrest.apache.org by th...@apache.org on 2005/08/09 09:34:32 UTC
svn commit: r231007 -
/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.view/resources/stylesheets/prepare.xhtml.xsl
Author: thorsten
Date: Tue Aug 9 00:33:57 2005
New Revision: 231007
URL: http://svn.apache.org/viewcvs?rev=231007&view=rev
Log:
fixed 'using forrest:property in contracts head section'. Now it is as well possible to parse props to the head. Thx for reporting Diwaker
Modified:
forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.view/resources/stylesheets/prepare.xhtml.xsl
Modified: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.view/resources/stylesheets/prepare.xhtml.xsl
URL: http://svn.apache.org/viewcvs/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.view/resources/stylesheets/prepare.xhtml.xsl?rev=231007&r1=231006&r2=231007&view=diff
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.view/resources/stylesheets/prepare.xhtml.xsl (original)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.view/resources/stylesheets/prepare.xhtml.xsl Tue Aug 9 00:33:57 2005
@@ -35,8 +35,11 @@
<alias:param name="path"/>
<xsl:comment>All xhtml head elements requested by the forrest:template</xsl:comment>
<alias:template name="getHead">
- <xsl:for-each select="/*/forrest:properties/*[@head='true' and count(. | key('head-template', @name)[1]) = 1]">
- <alias:call-template name="{@name}-head"/>
+ <xsl:for-each
+ select="/*/forrest:properties/*[@head='true' and count(. | key('head-template', @name)[1]) = 1]">
+ <xsl:variable name="name" select="@name"/>
+ <xsl:apply-templates mode="head"
+ select="//forrest:contract[@name=$name]"/>
</xsl:for-each>
</alias:template>
<xsl:comment>All xhtml body elements requested by the forrest:template</xsl:comment>
@@ -79,6 +82,24 @@
</xsl:attribute>
</link>
</xsl:template>
+ <xsl:template match="forrest:contract" mode="head">
+ <xsl:variable name="name" select="@name"/>
+ <xsl:if test="/*/forrest:properties/*[@head='true' and @name=$name]">
+ <!--If next son is not forrest:properties go on-->
+ <xsl:choose>
+ <xsl:when test="not(forrest:properties[@contract=$name])">
+ <alias:call-template name="{@name}-head"/>
+ </xsl:when>
+ <xsl:when test="forrest:properties[@contract=$name]">
+ <alias:call-template name="{@name}-head">
+ <xsl:for-each select="forrest:properties[@contract=$name]/forrest:property">
+ <alias:with-param name="{@name}" select="'{.}'"/>
+ </xsl:for-each>
+ </alias:call-template>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:template>
<xsl:template match="forrest:contract">
<xsl:variable name="name" select="@name"/>
<!--Test whether there is a body template needed-->
@@ -98,5 +119,6 @@
</xsl:when>
</xsl:choose>
</xsl:if>
+
</xsl:template>
</xsl:stylesheet>