XSL value-of evaluating variable as string and not node
843834Aug 13 2003 — edited Aug 21 2003Hi,
Take a look at this code. I've been wracking my brain trying to find something that would work with this:
<xsl:if test="starts-with(name(current()),'A_AstSavDL_SEQ_NBR_')">
<xsl:variable name="CURVAL">
<xsl:value-of select="concat('A_AstSavDL_CifSharAvailBal_',$CurNodeValue)"/>
</xsl:variable>
<xsl:element name="{concat('A_ASSET_CURVAL_',$CurNodeValue)}">
<xsl:value-of select="$CURVAL"/>
</xsl:element>
</xsl:if>
This is an example of the logic that i have to apply. This looks for any elements that will start with A_AstSavDL_SEQ_NBR_ and then grabs that CifSharAvailBal with the SEQ_NBR's value (CurNodeValue is already defined elsewhere in the XSL) which is the iterator for the block of XML. Instead of nesting blocks of these individual assets the XML is like this:
<Applicant>
<seq_1>1<seq_1>
<Amount_1 />
<seq_2>2<seq_2>
<Amount_2 />
<seq_3>3<seq_3>
<Amount_3 />
...
</Applicant>
That's why i need to grab the seq_nbr and then concatenate the name of the node with the current iterator.
HOWEVER!
<xsl:value-of select="$CURVAL"/>
gives the string of CURVAL instead of evaluating CURVAL as a valid node in the XML.
HELP! I can't think of a single thing to do. I tried using the value of CURVAL and putting it into the select of a param element, but the param kept giving me errors. What do you guys think?
Thanks
-Andrew