From: Lady <redacted>
Date: Thu, 2 May 2024 03:05:51 +0000 (-0400)
Subject: Add @data-tsv-header to TSV data cells
X-Git-Tag: 0.8.1~2
X-Git-Url: https://git.ladys.computer/Shushe/commitdiff_plain/0ace1c487d935c5a6e0c2414752d6d8017459667?ds=sidebyside

Add @data-tsv-header to TSV data cells

This produces pretty verbose output, but gzipping should be able to
significantly compress it as the attributes will be repeated verbatim
every row.
---

diff --git a/parsers/tsv.xslt b/parsers/tsv.xslt
index 9018bea..94a7395 100644
--- a/parsers/tsv.xslt
+++ b/parsers/tsv.xslt
@@ -53,6 +53,9 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one
 					<html:tr>
 						<for-each select="exsl:node-set($cols)/*[count(exsl:node-set($headcols)/*)>=position()]">
 							<html:td>
+								<attribute name="data-tsv-header">
+									<value-of select="exsl:node-set($headcols)/*[count(current()/preceding-sibling::*)+1]"/>
+								</attribute>
 								<value-of select="."/>
 								<if test="position()=count(exsl:node-set($headcols)/*)">
 									<for-each select="following-sibling::*">