3 ⁌ 📰 Caudex ∷ transforms/entry.xslt
5 © 2024 Lady [@ Lady’s Computer]
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/>.
11 <!ENTITY Caudex "urn:fdc:ladys.computer:20240204:Caudex:">
12 <!ENTITY 书社 "urn:fdc:ladys.computer:20231231:Shu1She4:">
15 xmlns="http://www.w3.org/1999/XSL/Transform"
16 xmlns:Caudex="urn:fdc:ladys.computer:20240204:Caudex"
17 xmlns:exsl="http://exslt.org/common"
18 xmlns:html="http://www.w3.org/1999/xhtml"
19 xmlns:书社="urn:fdc:ladys.computer:20231231:Shu1She4"
20 exclude-result-prefixes="exsl Caudex"
23 <import href="../lib/split.xslt"/>
24 <书社:id>&Caudex;entry.xslt</书社:id>
25 <template match="/html:div[@书社:parsed-by='&Caudex;catalog.xslt'][@class='entry']">
27 <for-each select="@*[namespace-uri()!='urn:fdc:ladys.computer:20231231:Shu1She4']">
30 <for-each select="html:div[@id='@']/html:div[@书社:parsed-by='&Caudex;codex-entry.xslt']">
31 <variable name="metadata" select="html:div[@书社:parsed-by='&书社;record-jar.xslt']/html:dl[1]"/>
32 <html:meta itemprop="&书社;title">
33 <attribute name="content">
34 <value-of select="$metadata//html:dt[string()='TITLE']/following-sibling::html:dd"/>
35 <if test="$metadata//html:dt[string()='TITLE'] and $metadata//html:dt[string()='ENTRY']">
38 <if test="$metadata//html:dt[string()='ENTRY']">
40 <value-of select="$metadata//html:dt[string()='ENTRY']/following-sibling::html:dd"/>
46 <if test="$metadata//html:dt[string()='TITLE']">
48 <value-of select="$metadata//html:dt[string()='TITLE']/following-sibling::html:dd"/>
51 <variable name="paragraphs">
52 <call-template name="Caudex:split">
53 <with-param name="source" select="string(html:pre[@书社:parsed-by='&书社;plain.xslt'])"/>
54 <with-param name="separator" select="'

'"/>
57 <for-each select="exsl:node-set($paragraphs)/*">
58 <variable name="lines">
59 <call-template name="Caudex:split">
60 <with-param name="source" select="string()"/>
63 <variable name="linespans" select="exsl:node-set($lines)/*"/>
64 <variable name="partype">
66 <when test="not($linespans[not(starts-with(., ' ') or starts-with(., '	'))])">
67 <text>blockquote</text>
74 <if test="$linespans[normalize-space()!='']">
75 <element name="html:{$partype}">
76 <for-each select="$linespans">
77 <if test="normalize-space()!=''">
78 <value-of select="normalize-space()"/>
79 <if test="following-sibling::*[normalize-space()!='']">