|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Understanding xsl:key
>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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








