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

RE: key with restricting the scope of use attribute

Subject: RE: key with restricting the scope of use attribute
From: "Michael Kay" <mhkay@xxxxxxxxxxxx>
Date: Fri, 11 May 2001 09:48:05 +0100
RE:  key with restricting the scope of use attribute
> I have a key that works when the match is anchored to
> fixed path /a/b/c
>
>   <xsl:key name="MyKey" match="/a/b/c" use="?"/>
>
> My ultimate goal is to recursively process //a/b/c
> using a single key using a breadth first or depth first
> algorithm. If the node I am currently processing is held
> in a variable $CurrentNode, how would you construct
> the key to restrict its matching to just this node? In other
> words, I need to form the use attribute knowing $CurrentNode
> so that match="//a/b/c" does not match anthing other than
> $CurrentNode.

There's some basic misunderstanding here about what a key is.

Think of <xsl:key> as being like "create index" in SQL: it defines an index
for all the "match"ed nodes in the document, that allows them to be
retrieved using the value of the "use" property. The contents of the index
are fixed when the source document is loaded, it doesn't make sense to
change them depending on the contents of a variable.

Mike Kay
Software AG


 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.