Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Re: Error in XPath Expression >Thread Next - Re: Error in XPath Expression Re: Error in XPath ExpressionTo: NULL Date: 11/1/2005 9:39:00 AM This is XML
<NewDataSet>
<Table>
<RowId>1</RowId>
<sAssignedUser>Accounting</sAssignedUser>
<startValue>1</startValue>
<endValue>6</endValue>
</Table>
<Table>
<RowId>2</RowId>
<sAssignedUser>Client Services</sAssignedUser>
<startValue>1</startValue>
<endValue>6</endValue>
</Table>
<NewDataSet>
This is XSL :
<xslt:key name="NewDataSet" match="Table" use="sAssignedUser"/>
<xslt:variable name="values2" select="NewDataSet/Table"/>
<xslt:variable name="values" select="key('NewDataSet',sAssignedUser)"/>
Value1 :
<xslt:value-of select="sum($values2/startValue)"/>
Value2 :
<xslt:value-of select="sum($values/startValue)"/>
Value1 should display the Group Total and Value2 should display the Grand
Total, when run this Grand Total is coming around 59 which is correct , but
when i add all the group totals its coming around 56 which is not correct,
this total should mach with Group Total.
Any Focus on this?
"Oleg Tkachenko [MVP]" wrote:
> xslspy wrote:
> > the out put should be like this ...
> > Roger Bos (sAssignedUser value from Table1) - 10 (GroupCount Value from
> > Table 2)
> > display sAssignedUser value from Table1 and the corrsponding GroupCount
> > value from Table2
> >
> > Roger Bos - 10
>
> Something like
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> version="1.0">
> <xsl:template match="NewDataSet">
> <xsl:for-each select="Table">
> <xsl:value-of select="sAssignedUser"/> - <xsl:value-of
> select="../Table2[GroupVal = current()/sAssignedUser]/GroupCount" />
>
> </xsl:for-each>
> </xsl:template>
> </xsl:stylesheet>
>
>
>
> --
> Oleg Tkachenko [XML MVP, MCAD]
> http://www.XmlLab.Net | http://www.XLinq.Net | http://blog.tkachenko.com
>
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
