[xsl] "fetching" elements by name with a tokenized list of names

Subject: [xsl] "fetching" elements by name with a tokenized list of names
From: Georges Schmitz <georges.schmitz@xxxxxxxxx>
Date: Fri, 16 Feb 2007 10:46:58 +0100
I don't have a clue why this one works:

  <xsl:for-each select="tokenize($extract.element,';')">
    <xsl:variable name="name" select="."/>
    <xsl:copy-of select="$annex/*[name()=$name]"/>
  </xsl:for-each>

and this one not:

  <xsl:for-each select="tokenize($extract.element,';')">
    <xsl:copy-of select="$annex/*[name()=.]"/>
  </xsl:for-each>

tokenize() delivers a sequence of string tokens, so what makes the
difference between referring to a string token in <xsl:for-each> by "."
directly (the latter) or by using an intermediary variable (the first case)?

Thanks for clearing this to me,
Georges

Current Thread