Re: [xsl] an error I do not understand

Subject: Re: [xsl] an error I do not understand
From: "Imsieke, Gerrit, le-tex" <gerrit.imsieke@xxxxxxxxx>
Date: Fri, 30 Sep 2011 02:12:34 +0200
On 2011-09-30 02:07, Graydon wrote:
   <xsl:key match="area" name="name2Area" use="@area"/>
   <xsl:template match="/">

Try memorizing the root before the context gets lost (because of the atomic values in for-each):


<xsl:variable name="root" select="root()" as="document-node(element(wkna-shared-cms))" />

     <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())"/>

And then use key('name2Area',current(), $root)

Untested though

Gerrit

Current Thread