]> Lady’s Gitweb - Vocab/blobdiff - transforms/cleanup.xslt
Update ⛩📰 书社 to 0.13.3; “simplify” build
[Vocab] / transforms / cleanup.xslt
diff --git a/transforms/cleanup.xslt b/transforms/cleanup.xslt
new file mode 100644 (file)
index 0000000..f572d60
--- /dev/null
@@ -0,0 +1,45 @@
+<?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:exsl="http://exslt.org/common"
+       xmlns:html="http://www.w3.org/1999/xhtml"
+       xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+       xmlns:owl="http://www.w3.org/2002/07/owl#"
+       xmlns:shacl="http://www.w3.org/ns/shacl#"
+       xmlns:xlink="http://www.w3.org/1999/xlink"
+       xmlns:书社="urn:fdc:ladys.computer:20231231:Shu1She4"
+       extension-element-prefixes="exsl"
+       version="1.0"
+>
+       <书社:id>urn:fdc:vocab.ladys.computer:20240731:transforms:cleanup.xslt</书社:id>
+       <template match="/rdf:RDF" mode="书社:finalize">
+               <variable name="fragment">
+                       <书社:raw-text>
+                               <text>&lt;?xml version="1.0"?></text>
+                               <element name="书社:serialize-xml">
+                                       <element name="rdf:RDF">
+                                               <for-each select="owl:Ontology/namespace::*">
+                                                       <copy/>
+                                               </for-each>
+                                               <apply-templates mode="书社:finalize"/>
+                                       </element>
+                               </element>
+                       </书社:raw-text>
+               </variable>
+               <apply-templates select="exsl:node-set($fragment)" mode="书社:finalize"/>
+       </template>
+       <template match="/rdf:RDF//@xlink:*|/rdf:RDF//@书社:*|/rdf:RDF//书社:*|/rdf:RDF//text()[not(ancestor::html:*) and normalize-space()='']|/rdf:RDF//comment()" mode="书社:finalize" priority="10"/>
+       <template match="/rdf:RDF//text()[not(ancestor::html:*) and normalize-space()!='']" mode="书社:finalize" priority="10">
+               <value-of select="normalize-space()"/>
+       </template>
+</transform>
This page took 0.023573 seconds and 4 git commands to generate.