I have an example of an XSLT transform which tests if a given value is contained in a list of values. The syntax is as follows:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
<xsl:template match="field">
<FIELD>
<xsl:choose>
<xsl:when test="current() = ('v1', 'val1')">
YES
</xsl:when>
<xsl:when test="current() = ('v2', 'val2')">
NO
</xsl:when>
<xsl:otherwise>
UNKNOWN
</xsl:otherwise>
</xsl:choose>
</FIELD>
</xsl:template>
</xsl:stylesheet>
The test XML:
<?xml version="1.0" encoding="iso-8859-1"?>
<doc>
<field>v1</field>
<field>val2</field>
<field>v3</field>
</doc>
The online XSLT testing tool is processing that correctly, but for example, IntelliJ, is screaming:
[ERROR]: Syntax error in 'current() = ('v1', 'val1')'
I have problems to find examples of this particular syntax on the internet in standard XSLT tutorials as well as on StackOverflow, using phrases like (xslt set syntax), (xslt value in) etc.
Is that syntax correct and standard-compliant, or some semi-official extension?