]> Lady’s Gitweb - Shushe/blobdiff - lib/literally.xslt
Provide metadata in transform; add attributes there
[Shushe] / lib / literally.xslt
diff --git a/lib/literally.xslt b/lib/literally.xslt
new file mode 100644 (file)
index 0000000..dc104e1
--- /dev/null
@@ -0,0 +1,58 @@
+<?xml version="1.0"?>
+<!--
+SPDX-FileCopyrightText: 2024 Lady <https://www.ladys.computer/about/#lady>
+SPDX-License-Identifier: MPL-2.0
+-->
+<!--
+⁌ ⛩️📰 书社 ∷ lib/literally.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:xslt="http://www.w3.org/1999/XSL/TransformAlias"
+       xmlns:书社="urn:fdc:ladys.computer:20231231:Shu1She4"
+       version="1.0"
+>
+       <template match="node()" mode="书社:literally">
+               <choose>
+                       <when test="self::*">
+                               <xslt:element name="{name()}" namespace="{namespace-uri()}">
+                                       <for-each select="@*">
+                                               <xslt:attribute name="{name()}" namespace="{namespace-uri()}">
+                                                       <xslt:text>
+                                                               <value-of select="."/>
+                                                       </xslt:text>
+                                               </xslt:attribute>
+                                       </for-each>
+                                       <apply-templates mode="书社:literally"/>
+                               </xslt:element>
+                       </when>
+                       <when test="self::text()">
+                               <xslt:text>
+                                       <value-of select="."/>
+                               </xslt:text>
+                       </when>
+                       <when test="self::processing-instruction()">
+                               <xslt:processing-instruction name="{local-name()}">
+                                       <xslt:text>
+                                               <value-of select="."/>
+                                       </xslt:text>
+                               </xslt:processing-instruction>
+                       </when>
+                       <when test="self::comment()">
+                               <xslt:comment>
+                                       <xslt:text>
+                                               <value-of select="."/>
+                                       </xslt:text>
+                               </xslt:comment>
+                       </when>
+                       <otherwise>
+                               <apply-templates mode="书社:literally"/>
+                       </otherwise>
+               </choose>
+       </template>
+</transform>
This page took 0.02363 seconds and 4 git commands to generate.