3 ⁌ ⛩️📰 书社 ∷ parsers/tsv.xslt
5 © 2023–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:exsl="http://exslt.org/common"
13 xmlns:exslstr="http://exslt.org/strings"
14 xmlns:html="http://www.w3.org/1999/xhtml"
15 xmlns:书社="urn:fdc:ladys.computer:20231231:Shu1She4"
16 exclude-result-prefixes="exsl exslstr"
19 <书社:id>urn:fdc:ladys.computer:20231231:Shu1She4:tsv.xslt</书社:id>
20 <template match="html:script[@type='text/tab-separated-values']">
21 <variable name="rows" select="exslstr:tokenize(., '
')[normalize-space(.) and not(starts-with(., '#'))]"/>
22 <variable name="head" select="$rows[1]"/>
23 <variable name="body" select="$rows[not(position()=1)]"/>
24 <html:table class="tsv">
27 <for-each select="exslstr:tokenize($head, '	')">
29 <value-of select="."/>
35 <for-each select="$body">
37 <for-each select="exslstr:tokenize(., '	')">
39 <value-of select="."/>