]> Lady’s Gitweb - Shushe/blob - lib/literally.xslt
Provide metadata in transform; add attributes there
[Shushe] / lib / literally.xslt
1 <?xml version="1.0"?>
2 <!--
3 SPDX-FileCopyrightText: 2024 Lady <https://www.ladys.computer/about/#lady>
4 SPDX-License-Identifier: MPL-2.0
5 -->
6 <!--
7 ⁌ ⛩️📰 书社 ∷ lib/literally.xslt
8
9 © 2024 Lady [@ Lady’s Computer].
10
11 This Source Code Form is subject to the terms of the Mozilla Public License, v 2.0.
12 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/>.
13 -->
14 <transform
15 xmlns="http://www.w3.org/1999/XSL/Transform"
16 xmlns:xslt="http://www.w3.org/1999/XSL/TransformAlias"
17 xmlns:书社="urn:fdc:ladys.computer:20231231:Shu1She4"
18 version="1.0"
19 >
20 <template match="node()" mode="书社:literally">
21 <choose>
22 <when test="self::*">
23 <xslt:element name="{name()}" namespace="{namespace-uri()}">
24 <for-each select="@*">
25 <xslt:attribute name="{name()}" namespace="{namespace-uri()}">
26 <xslt:text>
27 <value-of select="."/>
28 </xslt:text>
29 </xslt:attribute>
30 </for-each>
31 <apply-templates mode="书社:literally"/>
32 </xslt:element>
33 </when>
34 <when test="self::text()">
35 <xslt:text>
36 <value-of select="."/>
37 </xslt:text>
38 </when>
39 <when test="self::processing-instruction()">
40 <xslt:processing-instruction name="{local-name()}">
41 <xslt:text>
42 <value-of select="."/>
43 </xslt:text>
44 </xslt:processing-instruction>
45 </when>
46 <when test="self::comment()">
47 <xslt:comment>
48 <xslt:text>
49 <value-of select="."/>
50 </xslt:text>
51 </xslt:comment>
52 </when>
53 <otherwise>
54 <apply-templates mode="书社:literally"/>
55 </otherwise>
56 </choose>
57 </template>
58 </transform>
This page took 0.110921 seconds and 5 git commands to generate.