]> Lady’s Gitweb - Shushe/blobdiff - lib/catalog2destinations.xslt
Support pagination
[Shushe] / lib / catalog2destinations.xslt
index 6cad19814429a1f15a32a1e23ca9160aa98b1fcb..ae1ea29cfd455621e40b57b9d54b68dac42d6898 100644 (file)
@@ -14,7 +14,9 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one
 <transform
        xmlns="http://www.w3.org/1999/XSL/Transform"
        xmlns:catalog="urn:oasis:names:tc:entity:xmlns:xml:catalog"
+       xmlns:exslstr="http://exslt.org/strings"
        xmlns:书社="urn:fdc:ladys.computer:20231231:Shu1She4"
+       extension-element-prefixes="exslstr"
        version="1.0"
 >
        <template match="/">
@@ -26,7 +28,23 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one
                                        <text>|</text>
                                        <choose>
                                                <when test="$destination">
-                                                       <value-of select="$destination"/>
+                                                       <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>
                                                </when>
                                                <otherwise>
                                                        <value-of select="substring-after(@name, 'about:shushe?source=')"/>
This page took 0.019532 seconds and 4 git commands to generate.