changeset 25:a5125a2e77ea

towards inverted map of refs
author Henry S. Thompson <ht@markup.co.uk>
date Thu, 06 Apr 2017 18:31:46 +0100
parents 87e0d620deea
children d2ca3ea1f5ae
files refs.xsl visualise.xpl
diffstat 2 files changed, 27 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/refs.xsl	Thu Apr 06 17:24:30 2017 +0100
+++ b/refs.xsl	Thu Apr 06 18:31:46 2017 +0100
@@ -41,13 +41,13 @@
                 else $bit
             else ()"/>
    <ref c="{@r}">
-    <xsl:for-each select="$singles">
+    <xsl:for-each select="distinct-values($singles)">
      <s><xsl:value-of select="."/></s>
     </xsl:for-each>
-    <xsl:for-each select="$ranges">
+    <xsl:for-each select="distinct-values($ranges)">
      <r><xsl:value-of select="."/></r>
     </xsl:for-each>
-    <xsl:for-each select="$externals">
+    <xsl:for-each select="distinct-values($externals)">
      <e><xsl:value-of select="."/></e>
     </xsl:for-each>
    </ref></xsl:if>
--- a/visualise.xpl	Thu Apr 06 17:24:30 2017 +0100
+++ b/visualise.xpl	Thu Apr 06 18:31:46 2017 +0100
@@ -15,12 +15,16 @@
  
  <p:option name="format">
   <p:documentation xmlns="http://www.w3.org/1999/xhtml">
-   <div>If supplied, then use as stylesheet (located relative to elabDir)</div>
+   <div>If supplied, then use as stylesheet (located relative to elabDir), to
+produce pretty output (e.g. ascii, html)</div>
   </p:documentation>
  </p:option>
  
  <p:load name="ss1">
   <p:with-option name="href" select="concat($elabDir,'/format.xsl')"/>
+  <p:documentation>
+   <div>Use cell format and other cues in order to assign classes to cells</div>
+  </p:documentation>
  </p:load>
 
  <p:xslt name="format">
@@ -35,6 +39,9 @@
  
  <p:load name="ssr">
   <p:with-option name="href" select="concat($elabDir,'/refs.xsl')"/>
+  <p:documentation>
+   <div>Tokenise cell formulae and extract local, range and external references</div>
+  </p:documentation>
  </p:load>
 
  <p:xslt name="refs">
@@ -45,6 +52,22 @@
      <p:pipe step="ssr" port="result"/>
     </p:input>
  </p:xslt>
+ 
+ <p:load name="ssr2">
+  <p:with-option name="href" select="concat($elabDir,'/refs2.xsl')"/>
+  <p:documentation>
+   <div>Invert refs data into a map from cell to cells which point to it</div>
+  </p:documentation>
+ </p:load>
+ 
+ <p:xslt name="refs2">
+  <p:input port="source">
+   <p:pipe step="refs" port="result"/>
+  </p:input>
+  <p:input port="stylesheet">
+     <p:pipe step="ssr2" port="result"/>
+    </p:input>
+ </p:xslt>
 
  <p:load name="ss2">
   <p:with-option name="href" select="concat($elabDir,'/rect.xsl')"/>