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

an error I do not understand

Subject: an error I do not understand
From: Graydon <graydon@xxxxxxxxx>
Date: Thu, 29 Sep 2011 20:07:27 -0400
 an error I do not understand
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:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet exclude-result-prefixes="xs xd" version="2.0"
  xmlns:xd="http://www.oxygenxml.com/ns/doc/xsl"
  xmlns:xs="http://www.w3.org/2001/XMLSchema"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:variable name="areaNames" select="distinct-values(/wkna-shared-cms/area/@area)"/>
  <xsl:key match="area" name="name2Area" use="@area"/>
  <xsl:template match="/">
    <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())"/>
    </xsl:for-each>
  </xsl:template>
</xsl:stylesheet>

I get that the context node inside the for-each is an atomic value,
because once I use distinct-values() on the list of attribute values
that's what I get, but I don't understand why the key function can't
accept a string atomic value.

I've got the whole thing working using xsl:for-each-group, rather than
iterating directly through the area attribute values, but I'm right
stumped about why the above isn't acceptable to the parser, and am
hoping someone can explain it to me.

Thanks!
Graydon

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.