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 12:01:00 PM 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 | |||
|
