comparison refs.xsl @ 34:93fd0d532754

fix bug in refs wrt e.g. [1]!.SGX, adapt html and ascii to new-format refs, move a2n and n2a into separate files for re-use
author Henry S. Thompson <ht@markup.co.uk>
date Wed, 12 Apr 2017 21:35:04 +0100
parents 27bffc66ce10
children ae605b77d1e4
comparison
equal deleted inserted replaced
33:27bffc66ce10 34:93fd0d532754
61 return e:range(e:single($l,false()), 61 return e:range(e:single($l,false()),
62 e:single($r,false())) 62 e:single($r,false()))
63 else (), 63 else (),
64 $externals := for $i in (1 to count($tokens)) return 64 $externals := for $i in (1 to count($tokens)) return
65 let $t := $tokens[$i] return 65 let $t := $tokens[$i] return
66 if ($t/@nr=7) 66 if ($t/@nr=7 and $tokens[$i+1]='!')
67 then 67 then
68 let $ext := $t!='[0]', 68 let $ext := $t!='[0]',
69 $ref := e:single($tokens[$i + 2], 69 $ref := e:single($tokens[$i + 2],
70 $ext), 70 $ext),
71 $res := if ((($i+3) le $n) and 71 $res := if ((($i+3) le $n) and
116 <refs sheetName="{$sheet-name}"><xsl:apply-templates select="//s:c"/></refs> 116 <refs sheetName="{$sheet-name}"><xsl:apply-templates select="//s:c"/></refs>
117 </xsl:template> 117 </xsl:template>
118 118
119 <xsl:template match="s:c[s:f]"> 119 <xsl:template match="s:c[s:f]">
120 <xsl:variable name="tokens" select="e:tokenise(s:f/.)"/> 120 <xsl:variable name="tokens" select="e:tokenise(s:f/.)"/>
121 <xsl:if test="@r='xxx'"><xsl:message>|</xsl:message> 121 <xsl:if test="@r='xxx'"><xsl:message><xsl:value-of select="s:f"/>|<xsl:value-of select="(analyze-string(s:f/.,$pat)/xf:match/xf:group)[3]/@nr"/></xsl:message>
122 </xsl:if> 122 </xsl:if>
123 <xsl:if test="count($tokens)>0"> 123 <xsl:if test="count($tokens)>0">
124 <xsl:variable name="singles" select="$tokens?1"/> 124 <xsl:variable name="singles" select="$tokens?1"/>
125 <!-- Note that we don't bother to treat external ranges as ranges, 125 <!-- Note that we don't bother to treat external ranges as ranges,
126 since we're not going to try to detect cross-document refs --> 126 since we're not going to try to detect cross-document refs -->