apply-gen now uses `f:make-ref'
We're essentailly macro-expanding the `f:make-ref' call. :)master
parent
5857eed3d6
commit
bc871435fa
|
@ -36,6 +36,8 @@
|
||||||
xmlns:out="http://www.lovullo.com/hoxsl/apply/gen/_out"
|
xmlns:out="http://www.lovullo.com/hoxsl/apply/gen/_out"
|
||||||
exclude-result-prefixes="#default fgen">
|
exclude-result-prefixes="#default fgen">
|
||||||
|
|
||||||
|
<import href="../apply/ref.xsl" />
|
||||||
|
|
||||||
<output indent="yes"
|
<output indent="yes"
|
||||||
encoding="utf-8" />
|
encoding="utf-8" />
|
||||||
|
|
||||||
|
@ -119,11 +121,10 @@
|
||||||
dependencies and simply specify the full namespace URI -->
|
dependencies and simply specify the full namespace URI -->
|
||||||
<variable name="name-resolv"
|
<variable name="name-resolv"
|
||||||
select="resolve-QName( @name, . )" />
|
select="resolve-QName( @name, . )" />
|
||||||
<variable name="ns-prefix"
|
|
||||||
select="substring-before( @name, ':' )" />
|
|
||||||
<variable name="ns"
|
<variable name="ns"
|
||||||
select="namespace-uri-for-prefix(
|
select="namespace-uri-from-QName( $name-resolv )" />
|
||||||
$ns-prefix, . )" />
|
<variable name="ns-prefix"
|
||||||
|
select="prefix-from-QName( $name-resolv )" />
|
||||||
|
|
||||||
<sequence select="fgen:create-func(
|
<sequence select="fgen:create-func(
|
||||||
., $name-resolv, $ns-prefix, $ns )" />
|
., $name-resolv, $ns-prefix, $ns )" />
|
||||||
|
@ -164,15 +165,10 @@
|
||||||
<namespace name="{$ns-prefix}"
|
<namespace name="{$ns-prefix}"
|
||||||
select="$ns" />
|
select="$ns" />
|
||||||
|
|
||||||
<f:ref>
|
<variable name="arity"
|
||||||
<attribute name="arity"
|
|
||||||
select="count( $fnref/xsl:param )" />
|
select="count( $fnref/xsl:param )" />
|
||||||
|
|
||||||
<!-- represents the function being referenced -->
|
<sequence select="f:make-ref( $name-resolv, $arity )" />
|
||||||
<element name="{$local-name}"
|
|
||||||
namespace="{$ns}">
|
|
||||||
</element>
|
|
||||||
</f:ref>
|
|
||||||
</out:function>
|
</out:function>
|
||||||
</function>
|
</function>
|
||||||
|
|
||||||
|
|
|
@ -184,13 +184,39 @@
|
||||||
|
|
||||||
<!-- note that this _does not_ test f:arity itself: it is intended
|
<!-- note that this _does not_ test f:arity itself: it is intended
|
||||||
to test that the arity datum is properly generated -->
|
to test that the arity datum is properly generated -->
|
||||||
<scenario label="f:arity">
|
<scenario label="constructed dynamic function reference">
|
||||||
<call function="f:arity">
|
<variable name="two-result"
|
||||||
<param name="fnref" select="foo:sub-two()" />
|
select="foo:sub-two()" />
|
||||||
|
|
||||||
|
<scenario label="is recognized as">
|
||||||
|
<call function="f:is-ref">
|
||||||
|
<param name="fnref" select="$two-result" />
|
||||||
</call>
|
</call>
|
||||||
|
|
||||||
<expect label="is able to determine arity"
|
<expect label="a dynamic function reference"
|
||||||
test="$x:result = 2" />
|
select="true()" />
|
||||||
|
</scenario>
|
||||||
|
|
||||||
|
|
||||||
|
<scenario label="target QName">
|
||||||
|
<call function="f:QName">
|
||||||
|
<param name="fnref" select="$two-result" />
|
||||||
|
</call>
|
||||||
|
|
||||||
|
<expect label="is the QName of the target function"
|
||||||
|
select="QName( 'http://www.lovullo.com/_junk',
|
||||||
|
'sub-two' )" />
|
||||||
|
</scenario>
|
||||||
|
|
||||||
|
|
||||||
|
<scenario label="arity">
|
||||||
|
<call function="f:arity">
|
||||||
|
<param name="fnref" select="$two-result" />
|
||||||
|
</call>
|
||||||
|
|
||||||
|
<expect label="is the arity of target function"
|
||||||
|
select="2" />
|
||||||
|
</scenario>
|
||||||
</scenario>
|
</scenario>
|
||||||
</scenario>
|
</scenario>
|
||||||
</description>
|
</description>
|
||||||
|
|
Loading…
Reference in New Issue