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

Re: using xsl:key to generate list of back references

Subject: Re: using xsl:key to generate list of back references
From: "David Marston/CAM/Lotus" <David_Marston@xxxxxxxxx>
Date: Tue, 16 May 2000 12:00:16 -0400
generating keys using xsl
Sebastian Rahtz writes:
>What bothers me is the (relative) inelegance of

<xsl:for-each
  select="//ptr[generate-id(.)=generate-id(key('targets',@target)[1])]">

[based on <xsl:key name="targets" match="ptr" use="@target"/>]
>when what I really want to say is something like

 <xsl:for-each select="key('targets','')">

>and somehow access the indices of the key structure. Is this
>unreasonable of me? The processor has all the information I want,
>right to hand, but it forces me to send it off on a wild goose chase...

You need to be able to force the gathering of all the @target nodes
that will populate your "targets" keyspace, but the processor may be
implemented with lazy capture or evaluation of the nodes. Also, how do
you want to deal with the provision (in Section 12.2):

"There can be multiple keys in a document with the same node, same
key name, but different key values." In other words, more than one
value can be looked up in the keyspace to return the same node.

I could see a question about "ptr" nodes that don't have an @target.
If the proposed shortcut were implemented, some feature-creeper
would come along and request that there be an option to get one
extra slot for the unkeyed nodes.

Overall, there's no doubt about the strength of the demand for a
grouping capability keyed to uniqueness within some set of values.
.................David Marston


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.