changeset 35:e500d7c18aad

Fixed confusion wrt gen vs. num, nature of @ format (id=49)
author Henry S. Thompson <ht@markup.co.uk>
date Thu, 13 Apr 2017 23:09:58 +0100
parents 93fd0d532754
children ae605b77d1e4
files fmt.xml format.xsl notes.txt parse.py
diffstat 4 files changed, 9 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/fmt.xml	Wed Apr 12 21:35:04 2017 +0100
+++ b/fmt.xml	Thu Apr 13 23:09:58 2017 +0100
@@ -28,5 +28,5 @@
  <fmt i="46" class="time">[h]:mm:ss</fmt>
  <fmt i="47" class="time">mmss.0</fmt>
  <fmt i="48" class="num">##0.0E+0</fmt>
- <fmt i="49" class="at">@</fmt>
+ <fmt i="49" class="str">@</fmt><!-- Force any content to literal string -->
 </fmts>
--- a/format.xsl	Wed Apr 12 21:35:04 2017 +0100
+++ b/format.xsl	Thu Apr 13 23:09:58 2017 +0100
@@ -43,6 +43,7 @@
    <xsl:variable name="nfi" select="$xfs[position()-1=$i]/@numFmtId"/>
    <xsl:variable name="builtin" select="$fmts[@i=$nfi]"/>
    <xsl:variable name="biClass" select="$builtin/@class"/>
+  <xsl:if test="@r='xxx'"><xsl:message><xsl:value-of select="@r"/>: <xsl:value-of select="concat(@s,'|',$nfi,'|',$biClass)"/></xsl:message></xsl:if>
    <c>
     <xsl:choose>
       <xsl:when test="$biClass">
@@ -52,7 +53,7 @@
         </xsl:when>
         <xsl:otherwise>
          <xsl:attribute namespace="http://markup.co.uk/excel" name="type">num</xsl:attribute>
-         <xsl:if test="$biClass!='num'"><xsl:attribute namespace="http://markup.co.uk/excel" name="class">
+         <xsl:if test="not($biClass=('num','gen'))"><xsl:attribute namespace="http://markup.co.uk/excel" name="class">
         <xsl:value-of select="$biClass"/>
        </xsl:attribute></xsl:if>
         </xsl:otherwise>
--- a/notes.txt	Wed Apr 12 21:35:04 2017 +0100
+++ b/notes.txt	Thu Apr 13 23:09:58 2017 +0100
@@ -136,5 +136,8 @@
 (assuming average cell size of 30 bytes and row overhead of 20 (*
 18985 (+ 20 (* 102 30))) 58,473,800 bytes, which is big but tolerable...
 ----------------
-Back to ranges - 
-
+sample4 html reveals several problems: mistaken content based on class
+                                        bug, e.g. B4 is 'a' FIXED
+                                       highlighted cells are being
+                                        labelled as cur, e.g. B61 in
+                                        output of format.xsl FIXED
--- a/parse.py	Wed Apr 12 21:35:04 2017 +0100
+++ b/parse.py	Thu Apr 13 23:09:58 2017 +0100
@@ -24,7 +24,7 @@
       "[^" + cw + "]+(?:\.[^" + cw + "]+)*\\(",
       "\\)",
       "^=|\\(",
-      "'[^']+'",
+      "'[^']+'",   #((?:'[^']+')|(?:\[[0-9]+\][^!]*))
       "\$?[A-Z]+\$?[0-9]+",
       "[a-zA-Z_\\\\][a-zA-Z0-9._]*",
       "."]