Mercurial > hg > ooxml
changeset 3:2c115aefde6b
beginning work on elaboration of worksheets
author | Henry S. Thompson <ht@markup.co.uk> |
---|---|
date | Sat, 01 Apr 2017 12:57:31 +0800 |
parents | 263a1935d37d |
children | fe3fc6b2d890 |
files | fmt.xml format.xsl notes.txt |
diffstat | 3 files changed, 78 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/fmt.xml Sat Apr 01 12:57:31 2017 +0800 @@ -0,0 +1,31 @@ +<?xml version='1.0'?> +<fmts> + <!-- Built-in Excel cell format codes, from ISO/IEC 29500-1:2016(E) 18.8.30 --> + <fmt i="0" class="gen">General</fmt> + <fmt i="2" class="num">0.00</fmt> + <fmt i="3" class="num">#,##0</fmt> + <fmt i="4" class="num">#,##0.00</fmt> + <fmt i="9" class="num">0%</fmt> + <fmt i="10" class="num">0.00%</fmt> + <fmt i="11" class="num">0.00E+00</fmt> + <fmt i="12" class="rat"># ?/?</fmt> + <fmt i="13" class="rat"># ??/??</fmt> + <fmt i="14" class="date">mm-dd-yy</fmt> + <fmt i="15" class="date">d-mmm-yy</fmt> + <fmt i="16" class="date">d-mmm</fmt> + <fmt i="17" class="date">mmm-yy</fmt> + <fmt i="18" class="time">h:mm AM/PM</fmt> + <fmt i="19" class="time">h:mm:ss AM/PM</fmt> + <fmt i="20" class="time">h:mm</fmt> + <fmt i="21" class="time">h:mm:ss</fmt> + <fmt i="22" class="num">m/d/yy h:mm</fmt> + <fmt i="37" class="num">#,##0 ;(#,##0)</fmt> + <fmt i="38" class="num">#,##0 ;[Red](#,##0)</fmt> + <fmt i="39" class="num">#,##0.00;(#,##0.00)</fmt> + <fmt i="40" class="num">#,##0.00;[Red](#,##0.00)</fmt> + <fmt i="45" class="time">mm:ss</fmt> + <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> +</fmts>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/format.xsl Sat Apr 01 12:57:31 2017 +0800 @@ -0,0 +1,10 @@ +<?xml version='1.0'?> +<!DOCTYPE doc SYSTEM "../../../lib/xml/xsl.dtd" > +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0" xmlns:s="http://schemas.openxmlformats.org/spreadsheetml/2006/main"> + <xsl:variable name="xldir" select="replace(base-uri(),'/[^/]*/[^/]*$','')"/> + <xsl:variable name="styles" select="document(concat($xldir,'/styles.xml'))/*"></xsl:variable> + <xsl:variable name="cellXfs" select="$styles//s:cellXfs"/> + <xsl:template match="/"> + <xsl:message>|<xsl:value-of select="count($cellXfs/s:xf)"/>|</xsl:message> + </xsl:template> +</xsl:stylesheet>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/notes.txt Sat Apr 01 12:57:31 2017 +0800 @@ -0,0 +1,37 @@ +You can't depend on + <f si="..." t="shared"/> + That is, it's _true_, but you can have a table with shared formulae + that doesn't use it. Compare M17:T28 (see below, uses shared) and + C17:J28 (mostly no shared) in sample4 + +Looks like the result of a sweep-and-copy-{right,down} results in the +_new_ cells covered showing as 'shared': + + [ ][1][1][1][1]... + [2][2][2][2][2]... + [2][2][2][2][2]... + ... + +Presumably that one was right-then-down, down-then-right would give a +slightly different pattern +-------- +Thinking about a pipeline... + 1) convert all variable references into (verbose!) elts: + <!ELEMENT R EMPTY> + <!ATTLIST R + ac CDATA IMPLIED + rc CDATA IMPLIED + ar CDATA IMPLIED + rr CDATA IMPLIED> + + where e.g. ac is 'absolute column' + 'D6' --> <R rc='D' rr='6'/> + and + '$E5' --> <R ac='E' rr='5'/> +-------- +Identifying dates is . . . tedious. They will be ints or floats (?), +with s="<int>", where the int is a 0-origin index into the list of +<xf...numFmtId="<bin>".../> +children of <cellXfs> in styles.xml, and bin is a built-in date format +code, see 18.8.30 numFmt (Number Format) in ISO/IEC 29500-1:2016(E) == +C071691e.pdf