]> Lady’s Gitweb - Caudex/blob - parsers/catalog.xslt
Initial commit; minimal working implementation
[Caudex] / parsers / catalog.xslt
1 <?xml version="1.0"?>
2 <!--
3 ⁌ 🪾📰 Caudex ∷ parsers/catalog.xslt
4
5 © 2024 Lady [@ Lady’s Computer]
6
7 This Source Code Form is subject to the terms of the Mozilla Public License, v 2.0.
8 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/>.
9 -->
10 <transform
11 xmlns="http://www.w3.org/1999/XSL/Transform"
12 xmlns:Caudex="urn:fdc:ladys.computer:20240204:Caudex"
13 xmlns:catalog="urn:oasis:names:tc:entity:xmlns:xml:catalog"
14 xmlns:html="http://www.w3.org/1999/xhtml"
15 xmlns:xlink="http://www.w3.org/1999/xlink"
16 xmlns:书社="urn:fdc:ladys.computer:20231231:Shu1She4"
17 exclude-result-prefixes="catalog"
18 version="1.0"
19 >
20 <书社:id>urn:fdc:ladys.computer:20240204:Caudex:catalog.xslt</书社:id>
21 <template match="/catalog:catalog">
22 <html:div class="{substring-after(catalog:uri[@name='?']/@uri, 'about:')}" 书社:parsed-by="urn:fdc:ladys.computer:20240204:Caudex:catalog.xslt">
23 <if test="catalog:uri[@name='.']">
24 <attribute name="书社:destination">
25 <value-of select="catalog:uri[@name='.']/@uri"/>
26 </attribute>
27 </if>
28 <apply-templates select="catalog:uri[not(@name='?' or @name='.')]"/>
29 </html:div>
30 </template>
31 <template match="catalog:uri[not(@name='?' or @name='.')]">
32 <html:div id="{@name}">
33 <if test="contains(@uri, '?cksum=')">
34 <attribute name="Caudex:cksum">
35 <value-of select="substring-after(@uri, '?cksum=')"/>
36 </attribute>
37 </if>
38 <书社:link xlink:show="embed">
39 <attribute name="xlink:href">
40 <text>about:shushe?include=</text>
41 <choose>
42 <when test="contains(@uri, '?')">
43 <value-of select="substring-before(@uri, '?')"/>
44 </when>
45 <otherwise>
46 <value-of select="@uri"/>
47 </otherwise>
48 </choose>
49 </attribute>
50 </书社:link>
51 </html:div>
52 </template>
53 </transform>
This page took 0.053229 seconds and 5 git commands to generate.