forrest-svn mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thors...@apache.org
Subject svn commit: r380004 - /forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/hooksMatcher-html.xsl
Date Thu, 23 Feb 2006 00:43:32 GMT
Author: thorsten
Date: Wed Feb 22 16:43:27 2006
New Revision: 380004

URL: http://svn.apache.org/viewcvs?rev=380004&view=rev
Log:
Implementing renaming of @type values now inline and block.

Modified:
    forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/hooksMatcher-html.xsl

Modified: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/hooksMatcher-html.xsl
URL: http://svn.apache.org/viewcvs/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/hooksMatcher-html.xsl?rev=380004&r1=380003&r2=380004&view=diff
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/hooksMatcher-html.xsl
(original)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/hooksMatcher-html.xsl
Wed Feb 22 16:43:27 2006
@@ -23,30 +23,36 @@
     <xsl:apply-templates/>
   </xsl:template>
   <!--This template will match the different combinations for hooks-->
-  <xsl:template match="hook[@name and (@type='div' or not(@type) and not(@class))]">
-    <div id="{@name}">
-      <xsl:apply-templates/>
-      <xsl:if test="@nbsp='true'">&#160;</xsl:if>
-    </div>
+  <xsl:template match="hook">
+    <xsl:if test="@type='block' or not(@type)">
+      <div>
+        <xsl:call-template name="attributes"/>
+        <xsl:if test="@nbsp='true'"><xsl:text> </xsl:text></xsl:if>
+         <xsl:apply-templates/>
+      </div>
+    </xsl:if>
+    <xsl:if test="@type='inline'">
+      <span id="{@name}">
+        <xsl:call-template name="attributes"/>
+        <xsl:if test="@nbsp='true'"><xsl:text> </xsl:text></xsl:if>
+         <xsl:apply-templates/>
+      </span>
+    </xsl:if>
   </xsl:template>
-  <xsl:template match="hook[@class and (@type='div' or not(@type))]">
-    <div class="{@class}">
-      <xsl:apply-templates/>
-      <xsl:if test="@nbsp='true'">&#160;</xsl:if>
-    </div>
-  </xsl:template>
-  <xsl:template match="hook[@class and @type='span']">
-    <span class="{@class}"> 
-      <xsl:apply-templates/>
-      <xsl:if test="@nbsp='true'">&#160;</xsl:if>
-    </span>
-  </xsl:template>
-  <xsl:template match="hook[@name and @type='span']">
-    <span id="{@name}"> 
-      <xsl:apply-templates/>
-      <xsl:if test="@nbsp='true'">&#160;</xsl:if>
-    </span>
+  
+  <xsl:template name="attributes">
+    <xsl:if test="@name">
+      <xsl:attribute name="id">
+        <xsl:value-of select="@name" />
+      </xsl:attribute>
+    </xsl:if>
+    <xsl:if test="@class">
+      <xsl:attribute name="class">
+        <xsl:value-of select="@class" />
+      </xsl:attribute>
+    </xsl:if>
   </xsl:template>
+  
   <xsl:template match="@*|*|text()|processing-instruction()|comment()">
     <xsl:copy>
       <xsl:apply-templates 



Mime
View raw message