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

RE: RE: Forming a Tree

Subject: RE: RE: Forming a Tree
From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx>
Date: Fri, 12 Jul 2002 18:04:01 +0100
sutrave
> Hi Michael,
> Thanks for the response. I am new to XSL and I never used xsl:key, 
> could you pl help me, how to write the xsl:key for 
> <xsl:for-each select="//row[@ParentTopicId=@TopicId and 
> @BookId=$node1/@BookId and @TopicTitle]">. In xsl:for-each i 
> am using a variable, i am not getting how to 
> write xsl:key.
> 
The variable part of that expression is @BookId.

So

<xsl:key name="k" 
  match="row[@ParentTopicId=@TopicId and @TopicTitle]"
  use="@BookId"/>

then

<xsl:for-each select="key('k', $node1/@BookId)">

The key indexes all the rows that satisfy the "fixed" conditions by the
value of their @BookId. The select expression finds entries in that
index by supplying the required BookId. 

Michael Kay
Software AG
home: Michael.H.Kay@xxxxxxxxxxxx
work: Michael.Kay@xxxxxxxxxxxxxx 


 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.