changeset 22:ca98c74a7cb1

towards var handling, no lookup yet
author Henry S. Thompson <ht@markup.co.uk>
date Wed, 05 Apr 2017 11:57:00 +0100
parents f05f0d0ee296
children bfa38afaea63
files notes.txt refs.xsl
diffstat 2 files changed, 11 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/notes.txt	Wed Apr 05 11:24:11 2017 +0100
+++ b/notes.txt	Wed Apr 05 11:57:00 2017 +0100
@@ -44,5 +44,11 @@
 away?  Can throw away empty _rows_ in rect.xsl, but for _cells_ have
 to wait for ascii.xsl or html.xsl.  But only copy type in in rect if
 there was content before.
-
+-----------
+Not handling variables as references.  Not catching external
+references to variables.  Not catching naked [n]! as external
+references.
+ Fixed, but not dereferenced vars
+ The definition table is in workbook.xml definedNames/definedName[@name=$name]/.
+  Sheet name to filename mapping for locals is in workbook.xml sheets/sheet[@name=$sname]/@sheetId
  
--- a/refs.xsl	Wed Apr 05 11:24:11 2017 +0100
+++ b/refs.xsl	Wed Apr 05 11:57:00 2017 +0100
@@ -9,14 +9,14 @@
  </xsl:template>
  
  <xsl:template match="s:c[s:f]">
-  <xsl:variable name="tokens" select="analyze-string(.,$pat)/xf:match/xf:group"/>
-  <xsl:if test="@r='B1'"><xsl:message><xsl:value-of select="$tokens/@nr"/></xsl:message>
+  <xsl:variable name="tokens" select="analyze-string(s:f/.,$pat)/xf:match/xf:group"/>
+  <xsl:if test="@r='B4'"><xsl:message><xsl:value-of select="$tokens/@nr"/></xsl:message>
 <xsl:message><xsl:value-of select="$tokens/."/></xsl:message>
   </xsl:if>
-  <xsl:if test="$tokens[@nr=8]">
+  <xsl:if test="$tokens[@nr=(7,8,9)]">
    <xsl:variable name="n" select="count($tokens)"/>
    <xsl:variable name="singles" select="for $i in (1 to $n)
-       return if ($tokens[$i][@nr=8] and not($tokens[$i - 1][@nr=10 and .=(':','!')]) and not($tokens[$i + 1][@nr=10 and .=':']))
+       return if ($tokens[$i][@nr=(8,9)] and not($tokens[$i - 1][@nr=10 and .=(':','!')]) and not($tokens[$i + 1][@nr=10 and .=':']))
             then translate($tokens[$i],'$','')
             else ()"/>
    <xsl:variable name="ranges" select="for $i in (1 to count($tokens))