changeset 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 a5125a2e77ea
children 8309dcfce613
files rect.xsl visualise.xpl
diffstat 2 files changed, 4 insertions(+), 3 deletions(-) [+]
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>
--- a/visualise.xpl	Thu Apr 06 18:31:46 2017 +0100
+++ b/visualise.xpl	Fri Apr 07 18:42:47 2017 +0100
@@ -76,7 +76,7 @@
  <p:xslt name="rect">
    <p:input port="source">
     <p:pipe step="format" port="result"/>
-    <p:pipe step="refs" port="result"/>
+    <p:pipe step="refs2" port="result"/>
    </p:input>
   <p:input port="stylesheet">
    <p:pipe step="ss2" port="result"/>