changeset 53:8000dbed09df

better, now failing on [1]\!'AES,DIVIDEND'
author Henry S. Thompson <ht@markup.co.uk>
date Tue, 16 May 2017 19:09:03 +0100
parents 9bb415e0adc9
children 191c95187e87
files tokenise.xsl
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/tokenise.xsl	Tue May 16 17:28:52 2017 +0100
+++ b/tokenise.xsl	Tue May 16 19:09:03 2017 +0100
@@ -49,7 +49,7 @@
   <xsl:param name="col" required="yes" as="xs:integer"/>
   <xsl:param name="soFar" as="element(*)*"/>
   <xsl:variable name="last" select="$soFar[count($soFar)]"></xsl:variable>
-  <xsl:if test="$row=5 and $col=1"><xsl:message>tok1: <xsl:value-of select="$n"/>|<xsl:value-of select="$i"/>|<xsl:value-of select="if ($i=1) then string-join($tokens,'\') else $tokens[$i]"/>|<xsl:value-of select="if ($last instance of element()) then name($last) else 'bogus'"/>|<xsl:value-of select="string($last)"/></xsl:message></xsl:if>
+  <xsl:if test="false()"><xsl:message>tok1@<xsl:value-of select="$row"/>,<xsl:value-of select="$col"/>: <xsl:value-of select="$n"/>|<xsl:value-of select="$i"/>|<xsl:value-of select="if ($i=1) then string-join($tokens,'\') else string-join(($tokens[$i],':',$tokens[$i]/@nr,',',$tokens[$i+1],':',$tokens[$i+1]/@nr,',',$tokens[$i+2],':',$tokens[$i+2]/@nr),'')"/>|<xsl:value-of select="if ($last instance of element()) then name($last) else 'bogus'"/>|<xsl:value-of select="string($last)"/></xsl:message></xsl:if>
   <!-- Tail-recursion incrementing index $i into $tokens -->
   <xsl:sequence select="
     if ($i gt $n)
@@ -119,10 +119,10 @@
   <xsl:param name="i" as="xs:integer"/>
   <xsl:param name="soFar" as="xs:string"/><!-- Will always be a lonely ' -->
   <!-- Amalgamate bits of type 9 and 10 as <v> for wrapping in <e> -->
-  <xsl:variable name="content" select="e:amalgamate($tokens,$i,$soFar,10,$soFar)"/>
+  <xsl:variable name="content" select="e:amalgamate($tokens,$i,$soFar,(10,9),$soFar)"/>
   <xsl:variable name="x"><v><xsl:value-of select="
     if ($tokens[$content?1]=$soFar)
-    then $content?2
+    then concat($content?2,$soFar)
     else e:shouldnt('oddx',$tokens[$content?1])"/></v></xsl:variable>
   <xsl:sequence select="[$content?1+1,$x/*]"/>
  </xsl:function>