Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Error in XPath Expression

From: "Oleg Tkachenko [MVP]" <some@----.--->
To: 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


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent