Account for the possibility of a trailing slash in an url in pacakges.xsl

This commit is contained in:
Pierre Labastie 2014-05-08 20:58:12 +00:00
parent c4ad7bfd4e
commit ff9938fe50

View file

@ -40,7 +40,8 @@
<xsl:param name="url" select="foo"/> <xsl:param name="url" select="foo"/>
<xsl:variable name="sub-url" select="substring-after($url,'/')"/> <xsl:variable name="sub-url" select="substring-after($url,'/')"/>
<xsl:choose> <xsl:choose>
<xsl:when test="contains($sub-url,'/')"> <xsl:when test="contains($sub-url,'/') and
not(substring-after($sub-url,'/')='')">
<xsl:call-template name="package_name"> <xsl:call-template name="package_name">
<xsl:with-param name="url" select="$sub-url"/> <xsl:with-param name="url" select="$sub-url"/>
</xsl:call-template> </xsl:call-template>
@ -52,6 +53,10 @@
<xsl:value-of select="substring-before($sub-url,'?')"/> <xsl:value-of select="substring-before($sub-url,'?')"/>
<xsl:text>&#xA;</xsl:text> <xsl:text>&#xA;</xsl:text>
</xsl:when> </xsl:when>
<xsl:when test="contains($sub-url,'/')">
<xsl:value-of select="substring-before($sub-url,'/')"/>
<xsl:text>&#xA;</xsl:text>
</xsl:when>
<xsl:otherwise> <xsl:otherwise>
<xsl:value-of select="$sub-url"/> <xsl:value-of select="$sub-url"/>
<xsl:text>&#xA;</xsl:text> <xsl:text>&#xA;</xsl:text>