Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries [Thread Prev] >Thread Next - Re: using variable in xpath(xsl:for-each) using variable in xpath(xsl:for-each)To: NULL Date: 9/13/2007 7:07:00 PM
Hi,
I am trying to use variable instead of a hard coded string in xsl:for-
each statement in xslt .
Please find the attached code which is working
<xsl:variable name="test2" select="FIXINC:FixedIncomeInstrument"/>
<xsl:for-each select="$test2">
<testP1 type="String">
<xsl:value-of select="test"/>
</testP1>
</xsl:for-each>
However when I form test2 as follows then it stops working.It
says"Error in xpath expression"
<xsl:variable name="test1" select="'FixedIncomeInstrument'"/>
<xsl:variable name="test" select="concat('FIXINC',':')"/>
<xsl:variable name="test2" select="concat($test,$test1)"/>
<xsl:for-each select="$test2">
<testP1 type="String">
<xsl:value-of select="test"/>
</testP1>
</xsl:for-each>
Does anyone know how to solve this issue?
Thanks,
Pallavi
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
