`f:args' ignores adjacent data

master
Mike Gerwitz 2014-12-04 02:32:38 -05:00
parent 2760834bfb
commit e93283c608
2 changed files with 23 additions and 1 deletions

View File

@ -160,7 +160,12 @@
<function name="f:args" as="item()*">
<param name="fnref" as="item()+" />
<sequence select="remove( $fnref, 1 )" />
<variable name="desc" as="element( f:ref )"
select="$fnref[ 1 ]" />
<variable name="length" as="xs:double"
select="$desc/@length" />
<sequence select="subsequence( $fnref, 2, ( $length - 1 ) )" />
</function>

View File

@ -423,6 +423,23 @@
<expect label="returns no other items"
test="count( $x:result ) = 2" />
</scenario>
<scenario label="operating on a reference preceding adjacent data">
<call function="f:args">
<param name="fnref"
select="f:set-args( $test-fn, ($args/foo:a,
$args/foo:b) ),
'adjacent data'" />
</call>
<expect label="returns sequence of arguments by reference"
test="$x:result[ 1 ] is $args/foo:a
and $x:result[ 2 ] is $args/foo:b" />
<expect label="returns no adjacent data"
test="count( $x:result ) = 2" />
</scenario>
</scenario>