]> Lady’s Gitweb - Vocab/blobdiff - transforms/shared.xslt
Update ⛩📰 书社 to 0.13.3; “simplify” build
[Vocab] / transforms / shared.xslt
diff --git a/transforms/shared.xslt b/transforms/shared.xslt
new file mode 100644 (file)
index 0000000..d59cbdc
--- /dev/null
@@ -0,0 +1,41 @@
+<?xml version="1.0"?>
+<!--
+SPDX-FileCopyrightText: 2024, 2025 Lady <https://www.ladys.computer/about/#lady>
+SPDX-License-Identifier: MPL-2.0
+-->
+<!--
+© 2024–2025 Lady [@ Ladys 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:Vocab="urn:fdc:vocab.ladys.computer:20240731:ns"
+       xmlns:owl="http://www.w3.org/2002/07/owl#"
+       xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+       xmlns:shacl="http://www.w3.org/ns/shacl#"
+       xmlns:书社="urn:fdc:ladys.computer:20231231:Shu1She4"
+       exclude-result-prefixes="Vocab"
+       version="1.0"
+>
+       <书社:id>urn:fdc:vocab.ladys.computer:20240731:transforms:shared.xslt</书社:id>
+       <template name="Vocab:base">
+               <value-of select="//rdf:RDF//owl:Ontology/shacl:declare/shacl:namespace[preceding-sibling::shacl:prefix='']"/>
+       </template>
+       <template name="Vocab:prefix">
+               <param name="unprefixed" select="''"/>
+               <variable name="namespace" select="//rdf:RDF//owl:Ontology/shacl:declare/shacl:namespace[starts-with($unprefixed, string()) and string(preceding-sibling::shacl:prefix)!=''][1]"/>
+               <choose>
+                       <when test="not($namespace)">
+                               <value-of select="$unprefixed"/>
+                       </when>
+                       <otherwise>
+                               <value-of select="$namespace/preceding-sibling::shacl:prefix"/>
+                               <text>:</text>
+                               <value-of select="substring-after($unprefixed, $namespace)"/>
+                       </otherwise>
+               </choose>
+       </template>
+</transform>
This page took 0.155976 seconds and 4 git commands to generate.