Mercurial > hg > ooxml
diff rect.xsl @ 26:d2ca3ea1f5ae
plumb in and use inverted ref table (via key)
author | Henry S. Thompson <ht@markup.co.uk> |
---|---|
date | Fri, 07 Apr 2017 18:42:47 +0100 |
parents | 87e0d620deea |
children | 8309dcfce613 |
line wrap: on
line diff
--- a/rect.xsl Thu Apr 06 18:31:46 2017 +0100 +++ b/rect.xsl Fri Apr 07 18:42:47 2017 +0100 @@ -5,7 +5,7 @@ <xsl:variable name="refs" select="collection()[2]/*"/> - <xsl:key name="ref" match="e:ref" use="e:s"/> + <xsl:key name="ref" match="e:i" use="@r"/> <xsl:function name="e:a2n" as="xs:integer"> <!-- Convert an alphabetic excel column 'index' into a number, @@ -39,6 +39,7 @@ </xsl:template> <xsl:template match="s:sheetData"> + <xsl:message><xsl:value-of select="count($refs/*)"/></xsl:message> <xsl:if test="s:row"> <xsl:variable name="dims" select="analyze-string($dim,'([A-Z]+)([0-9]+):([A-Z]+)([0-9]+)')"/> <xsl:variable name="height" select="1+xs:integer($dims//xpf:group[@nr='4'])-xs:integer($dims//xpf:group[@nr='2'])"/> @@ -59,7 +60,7 @@ <c c="{$col}"> <xsl:if test="$c/s:f"><xsl:attribute name="f">1</xsl:attribute></xsl:if> <xsl:if test="$c/*"><t><xsl:value-of select="substring($c/@e:type,1,1)"/></t></xsl:if> - <xsl:if test="$reffed"><xsl:for-each select="$reffed/@c"><r><xsl:value-of select="."/></r></xsl:for-each></xsl:if> + <xsl:if test="$reffed"><xsl:copy-of select="$reffed/e:r"/></xsl:if> </c> </xsl:for-each></xsl:if> </r>