Cannot select a node here: the context item is an atomic value
- by user348810
While i execute this code it shownt the following error
Cannot select a node here: the context item is an atomic value,so that i can't sum up the fundunits
what is the problem ? why i can't able to sum up
<xsl:variable name="VAR_FUNDNAME" select="distinct-values(/SJPDATA/WEALTHSTAT[DOCUMENTTYPE=$MYDCTTYPE]/CLIENTINFO[CLIENTID=$MYCLIENT]/ancestor::*/PORTFOLIO/PENSIONS[CLIENTREF=$MYCLIENTTYPE][GROUPING=$MYGROUPINGVALUE]/PENSIONBREAKDOWN/FUNDNAME)"/>
<xsl:for-each select="$VAR_FUNDNAME">
<xsl:variable name="VAR_CURFUNDNAME" select="."/>
<myvar><xsl:value-of select="$VAR_CURFUNDNAME"/></myvar>
<xsl:if test="(/SJPDATA/WEALTHSTAT[DOCUMENTTYPE=$MYDCTTYPE]/CLIENTINFOCLIENTID=$MYCLIENT]/ancestor::*/PORTFOLIO/PENSIONS[CLIENTREF=$MYCLIENTTYPE][GROUPING=$MYGROUPINGVALUE]/PENSIONBREAKDOWN[FUNDNAME=string($VAR_CURFUNDNAME)][UNITTYPE='Acc'])"/>
<ASSETVALUATIONDATE><xsl:value-of select="min(/SJPDATA/WEALTHSTAT[DOCUMENTTYPE=$MYDCTTYPE]/CLIENTINFO[CLIENTID=$MYCLIENT]/ancestor::*/PORTFOLIO/PENSIONS[CLIENTREF=$MYCLIENTTYPE][GROUPING=$MYGROUPINGVALUE]/PENSIONBREAKDOWN[FUNDNAME=string($VAR_CURFUNDNAME)][UNITTYPE='Acc']/string(ASSETVALUATIONDATE))"/></ASSETVALUATIONDATE>
<PLANNUMBER></PLANNUMBER>
<FUNDNAME><xsl:value-of select="$VAR_CURFUNDNAME"/></FUNDNAME>
<FUNDUNITS><xsl:value-of select="string(sum(/SJPDATA/WEALTHSTAT[DOCUMENTTYPE=$MYDCTTYPE]/CLIENTINFO[CLIENTID=$MYCLIENT]/ancestor::*/PORTFOLIO/PENSIONS[CLIENTREF=$MYCLIENTTYPE][GROUPING=$MYGROUPINGVALUE]/PENSIONBREAKDOWN[FUNDNAME=string($VAR_CURFUNDNAME)][UNITTYPE='Acc']/FUNDUNITS))"/></FUNDUNITS>
</xsl:for-each>