3 ⁌ 📰 Caudex ∷ parsers/codex-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 xmlns="http://www.w3.org/1999/XSL/Transform"
12 xmlns:Caudex="urn:fdc:ladys.computer:20240204:Caudex"
13 xmlns:exsl="http://exslt.org/common"
14 xmlns:html="http://www.w3.org/1999/xhtml"
15 xmlns:书社="urn:fdc:ladys.computer:20231231:Shu1She4"
16 exclude-result-prefixes="exsl Caudex"
19 <import href="../lib/split.xslt"/>
20 <书社:id>urn:fdc:ladys.computer:20240204:Caudex:codex-entry.xslt</书社:id>
21 <template match="html:script[@type='text/x.codex-entry']">
22 <variable name="lines">
23 <call-template name="Caudex:split">
24 <with-param name="source" select="string()"/>
27 <variable name="linespans" select="exsl:node-set($lines)/*"/>
28 <variable name="record-end" select="$linespans[starts-with(., '%%')][last()]"/>
29 <variable name="text-start" select="$record-end/following-sibling::*[string()!=''][1]"/>
31 <html:script type="text/record-jar">
32 <for-each select="$record-end/preceding-sibling::*|$record-end">
33 <value-of select="."/>
37 <html:script type="text/plain">
38 <for-each select="$text-start|$text-start/following-sibling::*">
39 <value-of select="."/>