comparison n2a.xsl @ 52:9bb415e0adc9

try to fix error processin odd REUTER|IDN\!'.SPX' external ref
author Henry S. Thompson <ht@markup.co.uk>
date Tue, 16 May 2017 17:28:52 +0100
parents d3569a8cbf7a
children adeb9575b273
comparison
equal deleted inserted replaced
51:793496d2d165 52:9bb415e0adc9
41 concat(e:crnf($l), 41 concat(e:crnf($l),
42 ':', 42 ':',
43 e:crnf($r)) 43 e:crnf($r))
44 else if (local-name($b)='v') 44 else if (local-name($b)='v')
45 then $b/text() 45 then $b/text()
46 else e:shouldnt()"/> 46 else e:shouldnt('rnf',concat(local-name($b),' ',string($b)))"/>
47 </xsl:function> 47 </xsl:function>
48 48
49 <xsl:function name="e:fnf" as="xs:string"> 49 <xsl:function name="e:fnf" as="xs:string">
50 <!-- rebuild a formula from its parts, but using CRNF for all references --> 50 <!-- rebuild a formula from its parts, but using CRNF for all references -->
51 <xsl:param name="bits" as="element(*)*"/> 51 <xsl:param name="bits" as="element(*)*"/>
89 <xsl:param name="c" as="element(*)"/> 89 <xsl:param name="c" as="element(*)"/>
90 <xsl:param name="h" as="xs:integer"/> 90 <xsl:param name="h" as="xs:integer"/>
91 <xsl:value-of select="if (local-name($c)='a') then xs:integer($c/text()) 91 <xsl:value-of select="if (local-name($c)='a') then xs:integer($c/text())
92 else if (local-name($c)='r') 92 else if (local-name($c)='r')
93 then xs:integer($c/@d)+$h 93 then xs:integer($c/@d)+$h
94 else e:shouldnt()"/> 94 else e:shouldnt('delta',local-name($c))"/>
95 </xsl:function> 95 </xsl:function>
96 96
97 <xsl:template match="e:*|@*" mode="shift"> 97 <xsl:template match="e:*|@*" mode="shift">
98 <xsl:param name="row" as="xs:integer"/> 98 <xsl:param name="row" as="xs:integer"/>
99 <xsl:param name="col" as="xs:integer"/> 99 <xsl:param name="col" as="xs:integer"/>
104 </xsl:apply-templates> 104 </xsl:apply-templates>
105 </xsl:copy> 105 </xsl:copy>
106 </xsl:template> 106 </xsl:template>
107 107
108 <xsl:function name="e:shouldnt"> 108 <xsl:function name="e:shouldnt">
109 <xsl:message terminate="yes">shouldn't happen</xsl:message> 109 <xsl:param name="where" as="xs:string"/>
110 <xsl:param name="what" as="xs:string"/>
111 <xsl:message terminate="yes">shouldn't happen in <xsl:value-of select="$where"/>: <xsl:value-of select="$what"/></xsl:message>
110 </xsl:function> 112 </xsl:function>
111 </xsl:stylesheet> 113 </xsl:stylesheet>