From b384e5fad1238a737078752fa9bac6cc327ea70a Mon Sep 17 00:00:00 2001 From: Mike Gerwitz Date: Wed, 26 Nov 2014 23:43:56 -0500 Subject: [PATCH] Partial applications apply target function when all params are bound I am aware of the Saxon 9 warning regarding multiple imports of arity.xsl; I'm going to choose to ignore this, formally in the future. Each of the stylesheets is treated like a module. Michael Kay, Saxon's author, discusses it here: http://stackoverflow.com/a/10102298 --- src/apply/partial.xsl | 50 ++++++- test/apply.xspec | 2 +- test/apply/partial-test.xsl | 4 + test/apply/partial.xspec | 259 ++++++++++++++++++++++++++++++++---- 4 files changed, 281 insertions(+), 34 deletions(-) diff --git a/src/apply/partial.xsl b/src/apply/partial.xsl index e94d904..2208a95 100644 --- a/src/apply/partial.xsl +++ b/src/apply/partial.xsl @@ -26,16 +26,18 @@ + xmlns:f="http://www.lovullo.com/hoxsl/apply" + xmlns:_f="http://www.lovullo.com/hoxsl/apply/_priv"> @@ -72,6 +78,10 @@ select="f:arity( $ref )" /> + + + + @@ -157,4 +167,36 @@ $argn, ' arguments' ) )" /> + + + + + + + + + + + + + + + + + + + + + diff --git a/test/apply.xspec b/test/apply.xspec index 285268b..4ccce28 100644 --- a/test/apply.xspec +++ b/test/apply.xspec @@ -50,7 +50,7 @@ " + test="$x:result[ 1 ] = foo:applied[ @n = 0 ]" /> diff --git a/test/apply/partial-test.xsl b/test/apply/partial-test.xsl index 144d76b..99dfadd 100644 --- a/test/apply/partial-test.xsl +++ b/test/apply/partial-test.xsl @@ -29,6 +29,9 @@ + + + @@ -53,6 +56,7 @@ + diff --git a/test/apply/partial.xspec b/test/apply/partial.xspec index 902cc2c..eda5a53 100644 --- a/test/apply/partial.xspec +++ b/test/apply/partial.xspec @@ -36,6 +36,10 @@ + + + + @@ -76,41 +80,252 @@ + - + - + - - + - + - - + + + test="count( $x:result ) = 3" /> + test="$x:result[ 2 ] is $args/foo:a + and $x:result[ 3 ] is $args/foo:b" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -202,20 +417,6 @@ - - - - - - - - - -