]> Lady’s Gitweb - Caudex/blob - lib/split.xslt
Initial commit; minimal working implementation
[Caudex] / lib / split.xslt
1 <?xml version="1.0"?>
2 <!--
3 ⁌ 🪾📰 Caudex ∷ lib/split.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:html="http://www.w3.org/1999/xhtml"
14 exclude-result-prefixes="Caudex"
15 version="1.0"
16 >
17 <template name="Caudex:split">
18 <param name="source"/>
19 <param name="separator" select="'&#xA;'"/>
20 <choose>
21 <when test="contains($source, $separator)">
22 <html:span>
23 <value-of select="substring-before($source, $separator)"/>
24 </html:span>
25 <call-template name="Caudex:split">
26 <with-param name="source" select="substring-after($source, $separator)"/>
27 <with-param name="separator" select="$separator"/>
28 </call-template>
29 </when>
30 <otherwise>
31 <html:span>
32 <value-of select="$source"/>
33 </html:span>
34 </otherwise>
35 </choose>
36 </template>
37 </transform>
This page took 0.066377 seconds and 5 git commands to generate.