]> Lady’s Gitweb - Shushe/blobdiff - parsers/tsv.xslt
Automatically encapsulate metadata and preserve it
[Shushe] / parsers / tsv.xslt
index 4de3b9853401f6b838ac84afb2bdf2fe121ac0c5..ad7052e2fad764a55d610721ddc4401be6dd0b37 100644 (file)
@@ -2,7 +2,7 @@
 <!--
 ⁌ ⛩️📰 书社 ∷ parsers/tsv.xslt
 
 <!--
 ⁌ ⛩️📰 书社 ∷ parsers/tsv.xslt
 
-© 2023 Lady [@ Lady’s Computer]
+© 2023–2024 Lady [@ Lady’s Computer]
 
 This Source Code Form is subject to the terms of the Mozilla Public License, v 2.0.
 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/>.
 
 This Source Code Form is subject to the terms of the Mozilla Public License, v 2.0.
 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/>.
@@ -12,25 +12,27 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one
        xmlns:exsl="http://exslt.org/common"
        xmlns:exslstr="http://exslt.org/strings"
        xmlns:html="http://www.w3.org/1999/xhtml"
        xmlns:exsl="http://exslt.org/common"
        xmlns:exslstr="http://exslt.org/strings"
        xmlns:html="http://www.w3.org/1999/xhtml"
+       xmlns:书社="urn:fdc:ladys.computer:20231231:Shu1She4"
        exclude-result-prefixes="exsl exslstr"
        version="1.0"
 >
        exclude-result-prefixes="exsl exslstr"
        version="1.0"
 >
+       <书社:id>urn:fdc:ladys.computer:20231231:Shu1She4:tsv.xslt</书社:id>
        <template match="html:script[@type='text/tab-separated-values']">
                <variable name="rows" select="exslstr:tokenize(., '&#xA;')[normalize-space(.) and not(starts-with(., '#'))]"/>
        <template match="html:script[@type='text/tab-separated-values']">
                <variable name="rows" select="exslstr:tokenize(., '&#xA;')[normalize-space(.) and not(starts-with(., '#'))]"/>
-               <variable name="head" select="exsl:node-set($rows)[1]"/>
-               <variable name="body" select="exsl:node-set($rows)[not(position()=1)]"/>
-               <html:table>
+               <variable name="head" select="$rows[1]"/>
+               <variable name="body" select="$rows[not(position()=1)]"/>
+               <html:table class="tsv">
                        <html:thead>
                                <html:tr>
                                        <for-each select="exslstr:tokenize($head, '&#x9;')">
                        <html:thead>
                                <html:tr>
                                        <for-each select="exslstr:tokenize($head, '&#x9;')">
-                                               <html:th scope="row">
+                                               <html:th scope="col">
                                                        <value-of select="."/>
                                                </html:th>
                                        </for-each>
                                </html:tr>
                        </html:thead>
                        <html:tbody>
                                                        <value-of select="."/>
                                                </html:th>
                                        </for-each>
                                </html:tr>
                        </html:thead>
                        <html:tbody>
-                               <for-each select="exsl:node-set($body)">
+                               <for-each select="$body">
                                        <html:tr>
                                                <for-each select="exslstr:tokenize(., '&#x9;')">
                                                        <html:td>
                                        <html:tr>
                                                <for-each select="exslstr:tokenize(., '&#x9;')">
                                                        <html:td>
This page took 0.022178 seconds and 4 git commands to generate.