[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: an error I do not understand

Subject: Re: an error I do not understand
From: Michael Kay <mike@xxxxxxxxxxxx>
Date: Fri, 30 Sep 2011 09:47:42 +0100
Re:  an error I do not understand
On 30/09/2011 01:07, Graydon wrote:
So I've got a recurrent issue with taking big (~.5 Mlines, ~15 MiB)
files of metadata and merging them, or updating them.

(this happens in an XSLT 2.0 environment.)

Below is the minimal case of the error I do not understand:


<xsl:for-each select="$areaNames"> <!-- F [Saxon-PE 9.3.0.5] Leading '/' cannot select the root node of the tree containing the context item: the context item is an atomic value --> <xsl:sequence select="key('name2Area',current())"/>


There's an implicit third argument to key(), telling it which document to search. The default value is effectively "/" - that is, the document containing the context node. If there isn't a context, node, using "/" fails.


I must see if I can improve the error message (the problem is that Saxon expands the call at an early stage to use "/" explicitly, so the error message reflects the query as Saxon rewrote it, not the original as you wrote it.)

Michael Kay
Saxonica

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.