- <variable name="dir">
- <for-each select="exslstr:tokenize($destination, '/')[not(position()=last())]">
- <value-of select="."/>
- <text>/</text>
- </for-each>
- </variable>
- <variable name="name" select="string(exslstr:tokenize($destination, '/')[last()])"/>
- <value-of select="$dir"/>
- <choose>
- <when test="contains($name, '%s')">
- <value-of select="substring-before($name, '%s')"/>
- <value-of select="substring-after($name, '%s')"/>
- </when>
- <otherwise>
- <value-of select="$name"/>
- </otherwise>
- </choose>