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