Project

Profile

Help

Bug #4723

closed

XSLT 3 using function-lookup gives TypeError: h is not a function

Added by Martin Honnen over 4 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
XSLT Conformance
Sprint/Milestone:
-
Start date:
2020-09-04
Due date:
% Done:

100%

Estimated time:
Applies to JS Branch:
2
Fix Committed on JS Branch:
2
Fixed in JS Release:
SEF Generated with:
Platforms:
Company:
-
Contact person:
-
Additional contact persons:
-

Description

I have tried to run an XSLT 3 example using function-lookup that works fine with Saxon Java 10 HE through Saxon-JS 2 under Node with xslt3 but there it gives an error "TypeError: h is not a function".

Reduced test case is:

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    version="3.0"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:fn="http://www.w3.org/2005/xpath-functions"
    exclude-result-prefixes="#all"
    expand-text="yes">
    
    <xsl:mode on-no-match="shallow-copy"/>
    
    <xsl:template match="example">
        <xsl:copy>{
            function-lookup(xs:QName(function), count(arguments/arg))
            =>
            apply(array { arguments/arg })
        }</xsl:copy>
    </xsl:template>
    
    <xsl:template match="/" name="xsl:initial-template">
        <xsl:next-match/>
        <xsl:comment xmlns:saxon="http://saxon.sf.net/">Run with {system-property('xsl:product-name')} {system-property('xsl:product-version')} {system-property('Q{http://saxon.sf.net/}platform')}</xsl:comment>
    </xsl:template>
    
</xsl:stylesheet>

input sample:

<root>
    <example>
        <function>fn:concat</function>
        <arguments>
            <arg>a</arg>
            <arg>b</arg>
            <arg>c</arg>
        </arguments>
    </example>
</root>

Result with xslt3:

<?xml version="1.0" encoding="UTF-8"?><root>
    Transformation failure: TypeError: h is not a function
Transformation failed: TypeError: h is not a function

Expected result is the one I get with Saxon Java:

<?xml version="1.0" encoding="UTF-8"?><root>
    <example>abc</example>
</root>

Please register to edit this issue

Also available in: Atom PDF Tracking page