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/2/2005 6:45:00 AM This is the Key used to get the Grouping effect (group by sAssignedUser)
<xslt:key name="NewDataSet" match="Table" use="sAssignedUser"/>
And the below statement is used to get the group count..
<xslt:variable name="values" select="key('NewDataSet',sAssignedUser)"/>
and the below variable to get the grand total , as all the nodes loaded to
this variable and i thought of totalling the <startValue> value.
<xslt:variable name="values2" select="NewDataSet/Table"/>
Any suggestions on this?
"Oleg Tkachenko [MVP]" wrote:
> xslspy wrote:
> > 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)"/>
>
> This is wrong. Global variable is evaluated in the root node context, so
> obviously $values will be empty as there is no sAssignedUser in root
> node context. Which sAssignedUser do you mean here?
>
> --
> 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 | |||
|
