]> Lady’s Gitweb - Shushe/blobdiff - lib/metadata2destinations.xslt
Replace source catalog with metadata file
[Shushe] / lib / metadata2destinations.xslt
similarity index 52%
rename from lib/catalog2destinations.xslt
rename to lib/metadata2destinations.xslt
index 411c454f1f1215bbe92b2e4d3d3a86d2c7d15c1e..9410455399c9fd938f1254d99537acc27e91c336 100644 (file)
@@ -4,7 +4,7 @@ SPDX-FileCopyrightText: 2023, 2024 Lady <https://www.ladys.computer/about/#lady>
 SPDX-License-Identifier: MPL-2.0
 -->
 <!--
-⁌ ⛩️📰 书社 ∷ lib/catalog2destinations.xslt
+⁌ ⛩️📰 书社 ∷ lib/metadata2destinations.xslt
 
 © 2024 Lady [@ Lady’s Computer].
 
@@ -13,33 +13,36 @@ 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:dct="http://purl.org/dc/terms/"
        xmlns:exslstr="http://exslt.org/strings"
+       xmlns:nie="http://www.semanticdesktop.org/ontologies/2007/01/19/nie#"
+       xmlns:nfo="http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#"
+       xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
        xmlns:书社="urn:fdc:ladys.computer:20231231:Shu1She4"
        extension-element-prefixes="exslstr"
        version="1.0"
 >
        <template match="/">
-               <for-each select="//catalog:uri[starts-with(@name, 'about:shushe?source=')]">
+               <for-each select="/rdf:RDF/nfo:LocalFileDataObject[starts-with(@rdf:about, 'about:shushe?source=')]">
                        <choose>
-                               <when test="substring-after(@uri, '#')='xml'">
-                                       <variable name="destination" select="document(substring-before(@uri, '#'), .)/*/@书社:destination"/>
-                                       <value-of select="@name"/>
+                               <when test="nie:interpretedAs/nfo:PlainTextDocument and dct:hasFormat/*/nie:interpretedAs/*[@nie:mimeType='application/xml']">
+                                       <variable name="destination" select="document(dct:hasFormat/*[nie:interpretedAs/*[@nie:mimeType='application/xml']]/@nfo:fileUrl[1])/*/@书社:destination"/>
+                                       <value-of select="@rdf:about"/>
                                        <text>|</text>
                                        <choose>
                                                <when test="$destination">
                                                        <value-of select="$destination"/>
                                                </when>
                                                <otherwise>
-                                                       <value-of select="substring-after(@name, 'about:shushe?source=')"/>
+                                                       <value-of select="substring-after(@rdf:about, 'about:shushe?source=')"/>
                                                </otherwise>
                                        </choose>
                                        <text>&#xA;</text>
                                </when>
                                <otherwise>
-                                       <value-of select="@name"/>
+                                       <value-of select="@rdf:about"/>
                                        <text>|</text>
-                                       <value-of select="substring-after(@name, 'about:shushe?source=')"/>
+                                       <value-of select="substring-after(@rdf:about, 'about:shushe?source=')"/>
                                        <text>&#xA;</text>
                                </otherwise>
                        </choose>
This page took 0.024376 seconds and 4 git commands to generate.