[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: A problem using the xsl:key facility
On 7/20/2010 3:30 PM, Michael Kay wrote: > On 20/07/2010 21:17, Nathan Potter wrote: > > The key() function, when called with two arguments, always searches > within the current document (more accurately, the document containing > the context node). Your xsl:for-each changes the current document, so > you are searching the wrong thing. In XSLT 2.0 you can use the third > argument of the key() function to indicate which document you want to > search. Maybe this should go on the list of common XSLT mistakes. http://saxonica.blogharbor.com/blog/_archives/2010/6/11/4550606.html Even if it's not as common as others, this mistake is one that is hard to debug because there's a context dependency in the key() that one often doesn't think about (affected by a context change in the for-each that one often doesn't think about). Usually they "just work" fine, but when they don't, it's mysterious, even baffling. Lars
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|