+ <xslt:variable name="书社:destination">
+ <xslt:choose>
+ <xslt:when test="string($书社:source/@书社:destination)!=''">
+ <xslt:value-of select="$书社:source/@书社:destination"/>
+ </xslt:when>
+ <xslt:when test="starts-with($PATH, '/')">
+ <xslt:value-of select="substring-after($PATH, '/')"/>
+ </xslt:when>
+ <xslt:otherwise>
+ <xslt:value-of select="$PATH"/>
+ </xslt:otherwise>
+ </xslt:choose>
+ </xslt:variable>
+ <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>