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

RE: Understanding xsl:key

Subject: RE: Understanding xsl:key
From: "Chris Bayes" <Chris@xxxxxxxxxxx>
Date: Mon, 21 Aug 2000 12:22:48 +0100
understanding bayes
>From Jeni's reply
When you define the key:

> <xsl:key name="test" match="title" use="name"/>

Then you are setting up a number of associations between 'title' nodes and
key values given to them through their 'name' child:

node		key value
title[1]	'Design Patterns'
title[2]	'Pattern Hatching'
title[3]	'Building Applications'

When you use:

  key('test', 'Pattern Hatching')

you are saying "What nodes within the 'test' key have the key value of
'Pattern Hatching'?"

So
<xsl:key name="test" match="title" use="substring-before(name, ' ')"/>
will create 
node		key value
title[1]	'Design'
title[2]	'Pattern'
title[3]	'Building'

I assume though I haven't tried it.

Ciao Chris

XML/XSL Portal 
http://www.bayes.co.uk/xml


>-----Original Message-----
>From: owner-xsl-list@xxxxxxxxxxxxxxxx
>[mailto:owner-xsl-list@xxxxxxxxxxxxxxxx]On Behalf Of Heiner de Wendt
>Sent: 21 August 2000 10:18
>To: xsl-list@xxxxxxxxxxxxxxxx
>Subject: Re: Understanding xsl:key
>
>
>Hello,
>
>Jeni and everyone else, big thanks for the help. I've understood the 
>beast now, I think ;-)
>
>I have one last problem with it, though. If I use, e.g.,
>
><xsl:apply-templates select="key('test','Pattern Hatching')"/>
>
>this selects all my appropriate nodes with "Pattern Hatching" as
>contents. But if I wanna select all nodes in which the word "Pattern" 
>appears, I don't know how to do it. I've tried 
>"key('test',contains(.,'Pattern'))" and some other things like that, 
>but I don't get it to work.
>
>Big thanks again,
>
>Heiner
>
>
> XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


 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.