comparison refs.xsl @ 31:6270bef9b5d4

need to preserve abs ref info
author Henry S. Thompson <ht@markup.co.uk>
date Wed, 12 Apr 2017 11:36:27 +0100
parents 16eff0d30d4d
children f4432c1faf7f
comparison
equal deleted inserted replaced
30:16eff0d30d4d 31:6270bef9b5d4
47 $r := $tokens[$i + 1] return 47 $r := $tokens[$i + 1] return
48 if ($t/@nr=8 and 48 if ($t/@nr=8 and
49 not($l[@nr=10 and 49 not($l[@nr=10 and
50 .=(':','!')]) and 50 .=(':','!')]) and
51 not($r[@nr=10 and .=':'])) 51 not($r[@nr=10 and .=':']))
52 then translate($t,'$','') 52 then string($t)
53 else (), 53 else (),
54 $ranges := for $i in (1 to count($tokens)) return 54 $ranges := for $i in (1 to count($tokens)) return
55 let $t := $tokens[$i] return 55 let $t := $tokens[$i] return
56 if ($t[@nr=10 and .=':' and 56 if ($t[@nr=10 and .=':' and
57 not($i gt 2 and 57 not($i gt 2 and
60 $r := $tokens[$i + 1], 60 $r := $tokens[$i + 1],
61 $l1 := if ($l/@nr=9) then e:lookup($l) 61 $l1 := if ($l/@nr=9) then e:lookup($l)
62 else $l, 62 else $l,
63 $r1 := if ($r/@nr=9) then e:lookup($r) 63 $r1 := if ($r/@nr=9) then e:lookup($r)
64 else $r 64 else $r
65 return translate(concat($l1,':',$r1), 65 return concat($l1,':',$r1)
66 '$','')
67 else (), 66 else (),
68 $externals := for $i in (1 to count($tokens)) return 67 $externals := for $i in (1 to count($tokens)) return
69 let $t := $tokens[$i] return 68 let $t := $tokens[$i] return
70 if ($t/@nr=7) 69 if ($t/@nr=7)
71 then 70 then
72 let $bit := concat($t,'!', 71 let $bit := concat($t,'!',$tokens[$i + 2]) return
73 translate($tokens[$i + 2],
74 '$','')) return
75 if ((($i+3) le $n) and 72 if ((($i+3) le $n) and
76 $tokens[$i + 3][@nr=10 and .=':']) 73 $tokens[$i + 3][@nr=10 and .=':'])
77 then concat($bit,':', 74 then concat($bit,':',
78 translate($tokens[$i + 4],'$','')) 75 $tokens[$i + 4])
79 else $bit 76 else $bit
80 else () 77 else ()
81 return [($singles,for $a in $recur return $a?1), 78 return [($singles,for $a in $recur return $a?1),
82 ($ranges,for $a in $recur return $a?2), 79 ($ranges,for $a in $recur return $a?2),
83 ($externals,for $a in $recur return $a?3)] 80 ($externals,for $a in $recur return $a?3)]