2013-02-25 47 views

回答

2

嘗試這樣:

<xsl:variable name="tokens" select="tokenize(.,'/')"/> 
<xsl:value-of select="$tokens[not(.=$tokens[last()])]" separator="/"/> 

這是假設當前上下文path

0
<xsl:template match="path"> 
    <xsl:variable name="p" select="string-join(tokenize(., '/')[position() lt last()], '/')"/> 
</xsl:template> 

應該做的。

相關問題