DeltaXML / vscode-xslt-tokenizer

VSCode extension for highlighting XSLT and XPath (upto 3.0/3.1)
MIT License
46 stars 4 forks source link

Inline function call out of a map is recognized as stylesheet function call #106

Closed jperterm closed 2 years ago

jperterm commented 2 years ago

Calling an inline function which is in a map does produce the error XPath: Function: 'foo' with 0 arguments not found.

<xsl:template name="test">
        <xsl:variable name="map" as="map(*)" select="
            map{
                'foo': function(){'bar'}
            }"/>

        <!-- XPath: Function: 'foo' with 0 arguments not found -->
        <xsl:sequence select="$map?foo()"/>

        <!-- Alternative is fine -->
        <xsl:sequence select="($map?foo)()"/>
</xsl:template>
pgfearo commented 2 years ago

Thanks for reporting this issue., I will investigate and report back.

pgfearo commented 2 years ago

The linter must not report a problem (as it currently is) because it should not attempt to resolve foo() - Map lookup needs the dynamic context that is only available at run time.

pgfearo commented 2 years ago

Fixed