Mercurial > hg > ooxml
comparison merge.xsl @ 47:3e9a3e51627e
explicit form match working, but shared still needs work
author | Henry S. Thompson <ht@markup.co.uk> |
---|---|
date | Tue, 09 May 2017 23:08:18 +0100 |
parents | 6ed900e8cc61 |
children | 5d9806f90896 |
comparison
equal
deleted
inserted
replaced
46:8dd54346bfd8 | 47:3e9a3e51627e |
---|---|
5 | 5 |
6 <xsl:include href="a2n.xsl"/> | 6 <xsl:include href="a2n.xsl"/> |
7 <xsl:include href="n2a.xsl"/> | 7 <xsl:include href="n2a.xsl"/> |
8 | 8 |
9 <xsl:variable name="refs" select="collection()[2]/*"/> | 9 <xsl:variable name="refs" select="collection()[2]/*"/> |
10 <xsl:variable name="nfs"> | |
11 <xsl:for-each select="$refs/e:nf"> | |
12 <xsl:sort select="@n" order="descending" data-type="number"/> | |
13 <xsl:message><xsl:value-of select="@n"/>|<xsl:value-of select="position()"/>|<xsl:value-of select="text()"/></xsl:message> | |
14 <e:nf i="{position()}" n="{@n}"><xsl:value-of select="text()"/></e:nf> | |
15 </xsl:for-each> | |
16 </xsl:variable> | |
10 | 17 |
11 <xsl:key name="ref" match="e:i" use="@r"/> | 18 <xsl:key name="ref" match="e:i" use="@r"/> |
19 <xsl:key name="nf" match="e:nf" use="text()"/> | |
20 | |
21 <xsl:template match="/"><a><xsl:copy-of select="$nfs"/>|<xsl:value-of select="count($refs/e:i)"/>|<xsl:value-of select="count($nfs/e:nf)"/>|<xsl:value-of select="count(key('nf','SUM(ª2ª7:ª3ª7)',$nfs))"/>|<xsl:value-of select="count($nfs/e:nf[.='SUM(ª2ª7:ª3ª7)'])"/> | |
22 <xsl:apply-templates/></a> | |
23 </xsl:template> | |
12 | 24 |
13 <xsl:template match="e:r/e:c"> | 25 <xsl:template match="e:r/e:c"> |
14 <xsl:variable name="row" select="../@r"/> | 26 <xsl:variable name="row" select="../@r"/> |
15 <xsl:variable name="col" select="@c"/> | 27 <xsl:variable name="col" select="@c"/> |
16 <xsl:variable name="reffed" select="key('ref',concat(e:n2a($col),$row),$refs)"/> | 28 <xsl:variable name="reffed" select="key('ref',concat(e:n2a($col),$row),$refs)"/> |
17 <c> | 29 <c> |
18 <xsl:apply-templates select="@*"/> | 30 <xsl:apply-templates select="@*"/> |
19 <xsl:if test="e:f"> | 31 <xsl:if test="e:f"> |
20 <xsl:attribute name="f"></xsl:attribute> | 32 <xsl:message><xsl:value-of select="e:f"/></xsl:message> |
33 <xsl:attribute name="fi"><xsl:value-of select="key('nf',e:nf/text(),$nfs)/@i"/></xsl:attribute> | |
21 </xsl:if> | 34 </xsl:if> |
22 <xsl:if test="$reffed"><xsl:copy-of select="$reffed"/></xsl:if> | 35 <xsl:if test="$reffed"><xsl:copy-of select="$reffed"/></xsl:if> |
36 <xsl:apply-templates select="node()"/> | |
23 </c> | 37 </c> |
24 </xsl:template> | 38 </xsl:template> |
25 | 39 |
26 <xsl:template match="@*|node()"><xsl:copy><xsl:apply-templates select="@*|node()"/></xsl:copy> | 40 <xsl:template match="@*|node()"><xsl:copy><xsl:apply-templates select="@*|node()"/></xsl:copy> |
27 </xsl:template> | 41 </xsl:template> |