You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by je...@apache.org on 2003/01/04 04:09:55 UTC
cvs commit: xml-forrest/src/resources/library/xslt relativize-linkmap.xsl
jefft 2003/01/03 19:09:55
Modified: src/resources/library/xslt Tag: LINKMAP_BRANCH
relativize-linkmap.xsl
Log:
Don't add ..'s to absolute URLs
Revision Changes Path
No revision
No revision
1.1.2.2 +9 -2 xml-forrest/src/resources/library/xslt/Attic/relativize-linkmap.xsl
Index: relativize-linkmap.xsl
===================================================================
RCS file: /home/cvs/xml-forrest/src/resources/library/xslt/Attic/relativize-linkmap.xsl,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- relativize-linkmap.xsl 26 Dec 2002 14:36:12 -0000 1.1.2.1
+++ relativize-linkmap.xsl 4 Jan 2003 03:09:55 -0000 1.1.2.2
@@ -41,8 +41,15 @@
<xsl:template match="@href">
<xsl:attribute name="href">
- <xsl:value-of select="$root"/><xsl:value-of select="."/>
- </xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="starts-with(., 'http:') or starts-with(., 'https:')">
+ <xsl:value-of select="."/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$root"/><xsl:value-of select="."/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
</xsl:template>
<xsl:template match="@*|node()" priority="-1">