Mercurial > hg > ooxml
comparison n2a.xsl @ 43:5469a32795da
fix off-by-one error
author | Henry S. Thompson <ht@markup.co.uk> |
---|---|
date | Sun, 07 May 2017 11:55:50 +0100 |
parents | 93fd0d532754 |
children | 6ed900e8cc61 |
comparison
equal
deleted
inserted
replaced
42:6f448ac67778 | 43:5469a32795da |
---|---|
6 <xsl:function name="e:n2aa" as="xs:integer*"> | 6 <xsl:function name="e:n2aa" as="xs:integer*"> |
7 <!-- Does the real work for e:n2a --> | 7 <!-- Does the real work for e:n2a --> |
8 <xsl:param name="n" as="xs:integer"/> | 8 <xsl:param name="n" as="xs:integer"/> |
9 <xsl:sequence select="let $least := $codeBase+(($n - 1) mod 26)+1 | 9 <xsl:sequence select="let $least := $codeBase+(($n - 1) mod 26)+1 |
10 return if ($n < 27) then $least | 10 return if ($n < 27) then $least |
11 else (e:n2aa($n idiv 26),$least)"/> | 11 else (e:n2aa(($n - 1) idiv 26),$least)"/> |
12 </xsl:function> | 12 </xsl:function> |
13 | 13 |
14 <xsl:function name="e:n2a" as="xs:string"> | 14 <xsl:function name="e:n2a" as="xs:string"> |
15 <!-- Invert the a2n computation --> | 15 <!-- Invert the a2n computation --> |
16 <xsl:param name="n" as="xs:integer"/> | 16 <xsl:param name="n" as="xs:integer"/> |