forrest-svn mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thors...@apache.org
Subject svn commit: r280213 - in /forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.view: internal.xmap resources/stylesheets/prepare.view.xsl resources/stylesheets/prepare.xhtml.xsl
Date Sun, 11 Sep 2005 23:44:54 GMT
Author: thorsten
Date: Sun Sep 11 16:44:47 2005
New Revision: 280213

URL: http://svn.apache.org/viewcvs?rev=280213&view=rev
Log:
Added an xpathGenerator template to fix the bug regarding includes of nuggets. Need to strip
the forrest namespace from the filter to make it work.

Modified:
    forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.view/internal.xmap
    forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.view/resources/stylesheets/prepare.view.xsl
    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/internal.xmap
URL: http://svn.apache.org/viewcvs/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.view/internal.xmap?rev=280213&r1=280212&r2=280213&view=diff
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.view/internal.xmap
(original)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.view/internal.xmap
Sun Sep 11 16:44:47 2005
@@ -184,8 +184,8 @@
       {2} - requested url
   		--> 
     <map:match pattern="getStylesheet.*.**">
-      <map:aggregate element="forrest:filter">
-        <map:part src="cocoon://prepare.view.{2}" />
+      <map:aggregate element="filter">
+        <map:part src="cocoon://prepare.view-nugget.{2}" />
         <map:part src="cocoon://prepare.properties.{1}.{2}" /> 
       </map:aggregate>
       <map:transform src="resources/stylesheets/prepare.{1}.xsl" >

Modified: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.view/resources/stylesheets/prepare.view.xsl
URL: http://svn.apache.org/viewcvs/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.view/resources/stylesheets/prepare.view.xsl?rev=280213&r1=280212&r2=280213&view=diff
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.view/resources/stylesheets/prepare.view.xsl
(original)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.view/resources/stylesheets/prepare.view.xsl
Sun Sep 11 16:44:47 2005
@@ -33,7 +33,14 @@
   </xsl:template>
 
   <xsl:template match="forrest:property[@nugget]">
-    <forrest:property name="{@name}"><xi:include href="cocoon://{url}"/></forrest:property>
+    <xsl:element name="forrest:property">
+      <xsl:attribute name="name">
+        <xsl:value-of select="@name"/>
+      </xsl:attribute>
+       <xsl:element name="xi:include">
+        <xsl:attribute name="href">cocoon://<xsl:value-of select="url/text()"/></xsl:attribute>
+       </xsl:element>
+	  </xsl:element>
   </xsl:template>
 
   <xsl:template match="@*|*|text()|processing-instruction()|comment()">

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=280213&r1=280212&r2=280213&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
Sun Sep 11 16:44:47 2005
@@ -110,15 +110,20 @@
                     <alias:call-template name="{@name}-head"/>
                 </xsl:when>
                 <xsl:when test="forrest:properties[@contract=$name]">
-                    <alias:call-template name="{@name}-head">
+                    <alias:call-template name="{@name}-head"  xmlns:forrest="http://apache.org/forrest/templates/1.0">
                         <xsl:for-each select="forrest:properties[@contract=$name]/forrest:property">
-                            <alias:with-param name="{@name}" select="'{normalize-space(.)}'"/>
+                          <xsl:variable name="xpath">
+                            <xsl:value-of select="'/site'"/>
+                            <xsl:call-template name="generateXPath"/>
+                          </xsl:variable>
+                          <alias:with-param name="{@name}" select="{normalize-space($xpath)}"/>
                         </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-->
@@ -132,12 +137,21 @@
                 <xsl:when test="forrest:properties[@contract=$name]">
                     <alias:call-template name="{@name}-body">
                         <xsl:for-each select="forrest:properties[@contract=$name]/forrest:property">
-                            <alias:with-param name="{@name}" select="'{normalize-space(.)}'"/>
+                          <xsl:variable name="xpath">
+                            <xsl:value-of select="'/site'"/>
+                            <xsl:call-template name="generateXPath"/>
+                          </xsl:variable>
+                          <alias:with-param name="{@name}" select="{normalize-space($xpath)}"
/>
                         </xsl:for-each>
                     </alias:call-template>
                 </xsl:when>
             </xsl:choose>
         </xsl:if>
-        
     </xsl:template>
+    <xsl:template name="generateXPath">
+      <xsl:for-each select="ancestor::*[name()!='filter']">
+        /<xsl:value-of select="name()"/>[<xsl:number/>]
+      </xsl:for-each>
+      /<xsl:value-of select="name()"/>[<xsl:number/>]
+    </xsl:template> 
 </xsl:stylesheet>



Mime
View raw message