]> Lady’s Gitweb - Caudex/blob - parsers/catalog.xslt
Make repository REUSE‐compliant
[Caudex] / parsers / catalog.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 ⁌ 🪾📰 Caudex ∷ parsers/catalog.xslt
8
9 © 2024 Lady [@ Ladys 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:Caudex="urn:fdc:ladys.computer:20240204:Caudex"
17 xmlns:catalog="urn:oasis:names:tc:entity:xmlns:xml:catalog"
18 xmlns:html="http://www.w3.org/1999/xhtml"
19 xmlns:xlink="http://www.w3.org/1999/xlink"
20 xmlns:书社="urn:fdc:ladys.computer:20231231:Shu1She4"
21 exclude-result-prefixes="catalog"
22 version="1.0"
23 >
24 <书社:id>urn:fdc:ladys.computer:20240204:Caudex:catalog.xslt</书社:id>
25 <template match="/catalog:catalog">
26 <html:div class="{substring-after(catalog:uri[@name='?']/@uri, 'about:')}" 书社:parsed-by="urn:fdc:ladys.computer:20240204:Caudex:catalog.xslt">
27 <if test="catalog:uri[@name='.']">
28 <attribute name="书社:destination">
29 <value-of select="catalog:uri[@name='.']/@uri"/>
30 </attribute>
31 </if>
32 <apply-templates select="catalog:uri[not(@name='?' or @name='.')]"/>
33 </html:div>
34 </template>
35 <template match="catalog:uri[not(@name='?' or @name='.')]">
36 <html:div id="{@name}">
37 <if test="contains(@uri, '?cksum=')">
38 <attribute name="Caudex:cksum">
39 <value-of select="substring-after(@uri, '?cksum=')"/>
40 </attribute>
41 </if>
42 <书社:link xlink:show="embed">
43 <attribute name="xlink:href">
44 <text>about:shushe?include=</text>
45 <choose>
46 <when test="contains(@uri, '?')">
47 <value-of select="substring-before(@uri, '?')"/>
48 </when>
49 <otherwise>
50 <value-of select="@uri"/>
51 </otherwise>
52 </choose>
53 </attribute>
54 </书社:link>
55 </html:div>
56 </template>
57 </transform>
This page took 0.050671 seconds and 5 git commands to generate.