You are viewing a plain text version of this content. The canonical link for it is here.
Posted to svn@forrest.apache.org by fe...@apache.org on 2006/02/08 09:31:50 UTC

svn commit: r375896 - /forrest/trunk/main/webapp/skins/common/xslt/html/pathutils.xsl

Author: ferdinand
Date: Wed Feb  8 00:31:49 2006
New Revision: 375896

URL: http://svn.apache.org/viewcvs?rev=375896&view=rev
Log:
Documentation added

Modified:
    forrest/trunk/main/webapp/skins/common/xslt/html/pathutils.xsl

Modified: forrest/trunk/main/webapp/skins/common/xslt/html/pathutils.xsl
URL: http://svn.apache.org/viewcvs/forrest/trunk/main/webapp/skins/common/xslt/html/pathutils.xsl?rev=375896&r1=375895&r2=375896&view=diff
==============================================================================
--- forrest/trunk/main/webapp/skins/common/xslt/html/pathutils.xsl (original)
+++ forrest/trunk/main/webapp/skins/common/xslt/html/pathutils.xsl Wed Feb  8 00:31:49 2006
@@ -172,17 +172,24 @@
 -->
 <xsl:template name="normalize">
   <xsl:param name="path"/>
+    <!-- replace all \  with / -->
   <xsl:variable name="path-" select="translate($path, '\', '/')"/>
   <xsl:choose>
+      <!-- process relative refs here -->
     <xsl:when test="contains($path-, '/../')">
-
+       <!--  put part before /../ into $pa: "foo/bar" -->
       <xsl:variable name="pa" select="substring-before($path-, '/../')"/>
+        <!-- put part after first occurrence /../ into $th: "baz/index.html" -->
       <xsl:variable name="th" select="substring-after($path-, '/../')"/>
+        <!-- cut last real directory name before /../ and put rest in $pa- : "foo/"  -->
       <xsl:variable name="pa-">
         <xsl:call-template name="dirname">
           <xsl:with-param name="path" select="$pa"/>
         </xsl:call-template>
       </xsl:variable>
+      <!-- recombine pieces thus eliminating one .. and one dir step before it
+              and recurse into this template to eliminate more /../
+      -->  
       <xsl:variable name="pa-th" select="concat($pa-, $th)"/>
       <xsl:call-template name="normalize">
         <xsl:with-param name="path" select="$pa-th"/>