# HG changeset patch # User Henry S. Thompson # Date 1492015434 -3600 # Node ID 27bffc66ce10542bc5548dea53ba205e6226fc8f # Parent f4432c1faf7f3f5b09e270a71fd8672866c2eefc external vars preserved, [0]!... == internal handled, but note that children of ref may not be contiguous by name anymore diff -r f4432c1faf7f -r 27bffc66ce10 refs.xsl --- a/refs.xsl Wed Apr 12 14:33:47 2017 +0100 +++ b/refs.xsl Wed Apr 12 17:43:54 2017 +0100 @@ -49,7 +49,7 @@ not($l[@nr=10 and .=(':','!')]) and not($r[@nr=10 and .=':'])) - then e:single($t) + then e:single($t,false()) else (), $ranges := for $i in (1 to count($tokens)) return let $t := $tokens[$i] return @@ -58,19 +58,25 @@ $tokens[$i - 2][@nr=10 and .='!'])]) then let $l := $tokens[$i - 1], $r := $tokens[$i + 1] - return e:range(e:single($l), - e:single($r)) + return e:range(e:single($l,false()), + e:single($r,false())) else (), $externals := for $i in (1 to count($tokens)) return let $t := $tokens[$i] return if ($t/@nr=7) then - let $ref := e:single($tokens[$i + 2]) return - if ((($i+3) le $n) and - $tokens[$i + 3][@nr=10 and .=':']) - then e:external($t,e:range($ref, - e:single($tokens[$i+4]))) - else e:external($t,$ref) + let $ext := $t!='[0]', + $ref := e:single($tokens[$i + 2], + $ext), + $res := if ((($i+3) le $n) and + $tokens[$i + 3][@nr=10 and .=':']) + then e:range($ref, + e:single($tokens[$i+4], + $ext)) + else $ref return + if ($ext) + then e:external($t,$res) + else $res else () return [($singles,for $a in $recur return $a?1), ($ranges,for $a in $recur return $a?2), @@ -78,11 +84,20 @@ else ()"/> - - + + + - + + + + + + + + +