]> Lady’s Gitweb - Shushe/blobdiff - lib/catalog2destinations.xslt
Enable output redirection with 书社:destination
[Shushe] / lib / catalog2destinations.xslt
diff --git a/lib/catalog2destinations.xslt b/lib/catalog2destinations.xslt
new file mode 100644 (file)
index 0000000..cadb0c3
--- /dev/null
@@ -0,0 +1,43 @@
+<?xml version="1.0"?>
+<!--
+⁌ ⛩️📰 书社 ∷ lib/catalog2destinations.xslt
+
+© 2024 Lady [@ Lady’s Computer]
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v 2.0.
+If a copy of the M·P·L was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0/>.
+-->
+<transform
+       xmlns="http://www.w3.org/1999/XSL/Transform"
+       xmlns:catalog="urn:oasis:names:tc:entity:xmlns:xml:catalog"
+       xmlns:书社="urn:fdc:ladys.computer:20231231:Shu1She4"
+       version="1.0"
+>
+       <template match="/">
+               <for-each select="//catalog:uri[starts-with(@name, 'about:shushe?source=')]">
+                       <choose>
+                               <when test="substring-after(@uri, '#')='xml'">
+                                       <variable name="destination" select="document(substring-before(@uri, '#'), .)/*/@书社:destination"/>
+                                       <value-of select="@name"/>
+                                       <text>|</text>
+                                       <choose>
+                                               <when test="$destination">
+                                                       <value-of select="$destination"/>
+                                               </when>
+                                               <otherwise>
+                                                       <value-of select="substring-after(@name, 'about:shushe?source=')"/>
+                                               </otherwise>
+                                       </choose>
+                                       <text>&#xA;</text>
+                               </when>
+                               <otherwise>
+                                       <value-of select="@name"/>
+                                       <text>|</text>
+                                       <value-of select="substring-after(@name, 'about:shushe?source=')"/>
+                                       <text>&#xA;</text>
+                               </otherwise>
+                       </choose>
+               </for-each>
+       </template>
+       <output method="text" encoding="UTF-8"/>
+</transform>
This page took 0.024967 seconds and 4 git commands to generate.