Mercurial > hg > ooxml
changeset 42:6f448ac67778
merge working with new refs(2), rect
author | Henry S. Thompson <ht@markup.co.uk> |
---|---|
date | Tue, 02 May 2017 10:20:59 +0100 |
parents | afda541de4c4 |
children | 5469a32795da |
files | merge.xsl rect.xsl refs2.xsl |
diffstat | 3 files changed, 25 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/merge.xsl Tue May 02 10:20:59 2017 +0100 @@ -0,0 +1,25 @@ +<?xml version='1.0'?> +<!DOCTYPE doc SYSTEM "../../../lib/xml/xsl.dtd" > +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="3.0" xmlns:s="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:e="http://markup.co.uk/excel" exclude-result-prefixes="xs e s xpf" xmlns="http://markup.co.uk/excel" xmlns:xpf="http://www.w3.org/2005/xpath-functions"> + <xsl:strip-space elements="s:sheetData"/> + + <xsl:include href="a2n.xsl"/> + <xsl:include href="n2a.xsl"/> + + <xsl:variable name="refs" select="collection()[2]/*"/> + + <xsl:key name="ref" match="e:i" use="@r"/> + + <xsl:template match="e:r/e:c"> + <xsl:variable name="row" select="../@r"/> + <xsl:variable name="col" select="@c"/> + <xsl:variable name="reffed" select="key('ref',concat(e:n2a($col),$row),$refs)"/> + <c> + <xsl:apply-templates select="node()|@*"/> + <xsl:if test="$reffed"><xsl:copy-of select="$reffed"/></xsl:if> + </c> + </xsl:template> + + <xsl:template match="@*|node()"><xsl:copy><xsl:apply-templates select="@*|node()"/></xsl:copy> + </xsl:template> +</xsl:stylesheet>
--- a/rect.xsl Tue May 02 10:00:02 2017 +0100 +++ b/rect.xsl Tue May 02 10:20:59 2017 +0100 @@ -31,7 +31,6 @@ <xsl:variable name="r" select="concat(e:n2a($col),string($row))"/> <xsl:variable name="c" select="$cells[@r=$r]"/> <c c="{$col}"> - <xsl:if test="$c/s:f"><xsl:attribute name="f">1</xsl:attribute></xsl:if> <xsl:if test="$c/*"> <xsl:if test="$c/@e:class"><xsl:attribute name="t"><xsl:value-of select="substring($c/@e:class,1,1)"/></xsl:attribute></xsl:if> <xsl:if test="$c/@e:code"><xsl:attribute name="l"><xsl:value-of select="$c/@e:code"/></xsl:attribute></xsl:if>
--- a/refs2.xsl Tue May 02 10:00:02 2017 +0100 +++ b/refs2.xsl Tue May 02 10:20:59 2017 +0100 @@ -16,7 +16,6 @@ <xsl:key name="rrefBR" match="e:ref[e:r]" use="for $s in e:r/(e:s[2]) return translate($s/@r,'$','')"/> <xsl:template match="e:refs"> - <xsl:message><xsl:value-of select="count(e:ref/e:r)"/>|<xsl:value-of select="count(e:ref/e:r/(e:s[1]))"/>|<xsl:value-of select="distinct-values(count(e:ref/e:r/(e:s[1])))"/></xsl:message> <xsl:variable name="refs" select="."/> <xsl:variable name="invert"> <xsl:for-each select="distinct-values(