I have some trouble with selecting values in node set. I have a string variable,
which concatenate in path of next existed node in xml. But when i try to select valu from it,
it results in paste of value of this variable, not the value of node. I can`t find how i can
convert string to node set for proper selection. Please, help.
<xsl:for-each select="result/node()">
<xsl:copy>
<xsl:for-each select="./node()">
<xsl:copy>
<xsl:attribute name="rating">
<xsl:text>0</xsl:text>
</xsl:attribute>
<xsl:choose>
<xsl:when test="translate(
substring(.,1,3),
$upCase,
$lowCase
) = 'id_'">
<xsl:value-of select="."/>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="cval"
select="concat(
'/survey/checkbox_value/',
local-name(),
'/.'
)" />
<xsl:value-of select="$cval" />
</xsl:otherwise>
</xsl:choose>
</xsl:copy>
</xsl:for-each>
</xsl:copy>
</xsl:for-each>
You don’t need to convert anything. It could be done with plain xpath.