forrest-svn mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject svn commit: r160715 - forrest/trunk/main/webapp/resources/stylesheets/project2text.xsl
Date Sat, 09 Apr 2005 19:46:08 GMT
Author: rick
Date: Sat Apr  9 12:46:07 2005
New Revision: 160715

URL: http://svn.apache.org/viewcvs?view=rev&rev=160715
Log:
Allow for the extraction of child elements as well.  ie.

  <for:group-svg>
    <for:font/>
  </for:group-svg>

would be replaced by the value of the for:font element defined in the
skinconfig.xml.


Modified:
    forrest/trunk/main/webapp/resources/stylesheets/project2text.xsl

Modified: forrest/trunk/main/webapp/resources/stylesheets/project2text.xsl
URL: http://svn.apache.org/viewcvs/forrest/trunk/main/webapp/resources/stylesheets/project2text.xsl?view=diff&r1=160714&r2=160715
==============================================================================
--- forrest/trunk/main/webapp/resources/stylesheets/project2text.xsl (original)
+++ forrest/trunk/main/webapp/resources/stylesheets/project2text.xsl Sat Apr  9 12:46:07 2005
@@ -28,8 +28,22 @@
   <xsl:variable name="config" select="//skinconfig"/>
 
   <xsl:template match="for:*">
-    <xsl:variable name="tmp" select="local-name()"/>
-    <xsl:value-of select="$config/*[local-name() = $tmp]"/>
+    <xsl:param name="ancestorpath" select="''"/>
+    <xsl:choose>
+      <xsl:when test="*">
+        <xsl:apply-templates>
+          <xsl:with-param name="ancestorpath"
+            select="concat($ancestorpath,'/',local-name())"/>
+        </xsl:apply-templates>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:variable name="tmp"
+          select="concat($ancestorpath, '/', local-name())"/>
+        <xsl:value-of
+          select="$config//*[concat($ancestorpath, '/', local-name()) = $tmp]"/>
+      </xsl:otherwise>
+    </xsl:choose>
+
   </xsl:template>
 
 </xsl:stylesheet>



Mime
View raw message