Cannot select a node here: the context item is an atomic value
Posted
by user348810
on Stack Overflow
See other posts from Stack Overflow
or by user348810
Published on 2010-05-24T14:01:35Z
Indexed on
2010/05/24
14:21 UTC
Read the original article
Hit count: 139
xslt
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>
© Stack Overflow or respective owner