diff 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
line wrap: on
line diff
--- a/refs.xsl	Wed Apr 12 17:43:54 2017 +0100
+++ b/refs.xsl	Wed Apr 12 21:35:04 2017 +0100
@@ -63,7 +63,7 @@
                              else (),
                   $externals := for $i in (1 to count($tokens)) return
                             let $t := $tokens[$i] return
-                            if ($t/@nr=7)
+                            if ($t/@nr=7 and $tokens[$i+1]='!')
                              then 
                               let $ext := $t!='[0]',
                                   $ref := e:single($tokens[$i + 2],
@@ -118,7 +118,7 @@
  
  <xsl:template match="s:c[s:f]">
   <xsl:variable name="tokens" select="e:tokenise(s:f/.)"/>
-  <xsl:if test="@r='xxx'"><xsl:message>|</xsl:message>
+  <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>
   </xsl:if>
   <xsl:if test="count($tokens)>0">
    <xsl:variable name="singles" select="$tokens?1"/>