DeltaXML / vscode-xslt-tokenizer

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

False error when constructing default namespace #120

Closed jperterm closed 1 year ago

jperterm commented 1 year ago

According to the XSLT (3.0) spec <xsl:namespace> requires a name attribute, but its value can be zero-length effectively to create a default namespace node.

The following XSLT causes the false error XSLT: Invalid XSLT name: '' for the case described:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="#all" version="3.0">
    <xsl:template match="/*" mode="#all">
        <element>
            <xsl:namespace name="" select="'urn:default-namespace'"/>
        </element>
    </xsl:template>
</xsl:stylesheet>
pgfearo commented 1 year ago

Thanks for reporting this problem. The linter was treating the name attribute of xsl:namespace the same as for other XSLT instructions where name must have a non-empty string value.

The issue has been fixed and is in the latest release: 1.5.8.