Mercurial > hg > ooxml
comparison a2n.xsl @ 48:5d9806f90896
basic integration of shared, but copying <f> is wrong, should reconstruct by denormalising <nf> for new home
author | Henry S. Thompson <ht@markup.co.uk> |
---|---|
date | Wed, 10 May 2017 16:52:04 +0100 |
parents | ae605b77d1e4 |
children |
comparison
equal
deleted
inserted
replaced
47:3e9a3e51627e | 48:5d9806f90896 |
---|---|
11 $lv := string-to-codepoints(substring($aa,$l))-$codeBase | 11 $lv := string-to-codepoints(substring($aa,$l))-$codeBase |
12 return if ($l=1) then $lv | 12 return if ($l=1) then $lv |
13 else $lv+(26*e:a2n(substring($aa,1,$l - 1)))"/> | 13 else $lv+(26*e:a2n(substring($aa,1,$l - 1)))"/> |
14 </xsl:function> | 14 </xsl:function> |
15 | 15 |
16 <xsl:function name="e:pr" as="element(xpf:analyze-string-result)"> | |
17 <xsl:param name="ref" as="xs:string"/> | |
18 <xsl:sequence select="analyze-string($ref,'([$]?)([A-Z]+)([$]?)([0-9]+)')"/> | |
19 </xsl:function> | |
20 | |
16 <xsl:function name="e:cr" as="element(e:s)"> | 21 <xsl:function name="e:cr" as="element(e:s)"> |
17 <!-- Parse a single cell reference into left and right halves, | 22 <!-- Parse a single cell reference into left and right halves, |
18 either e:a(bsolute) or e:r(elocatable) --> | 23 either e:a(bsolute) or e:r(elocatable) --> |
19 <xsl:param name="ref" as="xs:string" required="yes"/> | 24 <xsl:param name="ref" as="xs:string" required="yes"/> |
20 <xsl:param name="row" as="xs:integer" required="yes"/> | 25 <xsl:param name="row" as="xs:integer" required="yes"/> |
21 <xsl:param name="col" as="xs:integer" required="yes"/> | 26 <xsl:param name="col" as="xs:integer" required="yes"/> |
22 <xsl:variable name="cr" select="analyze-string($ref,'([$]?)([A-Z]+)([$]?)([0-9]+)')"/> | 27 <xsl:variable name="cr" select="e:pr($ref)"/> |
23 <xsl:variable name="c" select="if ($cr//xpf:group[@nr=1][text()]) then 'a' else 'r'"/> | 28 <xsl:variable name="c" select="if ($cr//xpf:group[@nr=1][text()]) then 'a' else 'r'"/> |
24 <xsl:variable name="cv" select="e:a2n($cr//xpf:group[@nr=2])"/> | 29 <xsl:variable name="cv" select="e:a2n($cr//xpf:group[@nr=2])"/> |
25 <xsl:variable name="r" select="if ($cr//xpf:group[@nr=3][text()]) then 'a' else 'r'"/> | 30 <xsl:variable name="r" select="if ($cr//xpf:group[@nr=3][text()]) then 'a' else 'r'"/> |
26 <xsl:variable name="rv" select="xs:integer($cr//xpf:group[@nr=4])"/> | 31 <xsl:variable name="rv" select="xs:integer($cr//xpf:group[@nr=4])"/> |
27 <s r="{$ref}"> | 32 <s r="{$ref}"> |