There are two obvious, simple solutions, one of which is only supported in XSLT 2.0:
I. General decision
This works with both XSLT 1.0 and XSLT 2.0.
node -set , ( <xsl:stylesheet>.)
:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:my="my:my" exclude-result-prefixes="my"
>
<xsl:output method="text"/>
<my:nodes>
<string>Hello </string>
<string>World</string>
</my:nodes>
<xsl:variable name="vLookup"
select="document('')/*/my:nodes/*"/>
<xsl:param name="pSearchWord" select="'World'"/>
<xsl:template match="/">
<xsl:if test="$pSearchWord = $vLookup">
<xsl:value-of select=
"concat('Found the word ', $pSearchWord)"/>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
XML- ( ), :
Found the word World
, xxx:node-set().
II. XSLT 2.0/XPath 2.0
XSLT 2.0/XPath 2.0 . , , :
<xsl:variable name="vLookup" as="xs:string*"
select="'Hello', 'World'"/>
:
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
>
<xsl:output method="text"/>
<xsl:variable name="vLookup" as="xs:string*"
select="'Hello', 'World'"/>
<xsl:param name="pSearchWord" select="'World'"/>
<xsl:template match="/">
<xsl:if test="$pSearchWord = $vLookup">
<xsl:value-of select=
"concat('Found the word ', $pSearchWord)"/>
</xsl:if>
</xsl:template>
</xsl:stylesheet>