comparison merge.xsl @ 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
children 6ed900e8cc61
comparison
equal deleted inserted replaced
41:afda541de4c4 42:6f448ac67778
1 <?xml version='1.0'?>
2 <!DOCTYPE doc SYSTEM "../../../lib/xml/xsl.dtd" >
3 <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">
4 <xsl:strip-space elements="s:sheetData"/>
5
6 <xsl:include href="a2n.xsl"/>
7 <xsl:include href="n2a.xsl"/>
8
9 <xsl:variable name="refs" select="collection()[2]/*"/>
10
11 <xsl:key name="ref" match="e:i" use="@r"/>
12
13 <xsl:template match="e:r/e:c">
14 <xsl:variable name="row" select="../@r"/>
15 <xsl:variable name="col" select="@c"/>
16 <xsl:variable name="reffed" select="key('ref',concat(e:n2a($col),$row),$refs)"/>
17 <c>
18 <xsl:apply-templates select="node()|@*"/>
19 <xsl:if test="$reffed"><xsl:copy-of select="$reffed"/></xsl:if>
20 </c>
21 </xsl:template>
22
23 <xsl:template match="@*|node()"><xsl:copy><xsl:apply-templates select="@*|node()"/></xsl:copy>
24 </xsl:template>
25 </xsl:stylesheet>