I am using XPath together with XSLT (both version 2.0). I’d like to get a list of strings except for a single string:
<xsl:param name="lang" select="'de'"/>
<xsl:variable name="all-languages" select="('en','de','fr')"/>
<xsl:variable name="other-languages" select="$all-languages except $lang "/>
For a documentation project, I’d like to generate the documentation in $lang and link to all other languages. So it would be nice to get (in the example above) $other-languages to ('de','fr') and use <xsl:for-each> to iterate over the languages except for the string in $lang.
except seems to work only for nodes. What is the nicest solution for the problem?
Simpler and more efficient: