This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Compound Keys Problem.
- To: william dot crawley at ukonline dot co dot uk
- Subject: Re: [xsl] Compound Keys Problem.
- From: Jeni Tennison <mail at jenitennison dot com>
- Date: Fri, 12 Jan 2001 09:26:18 +0000
- CC: xsl-list at lists dot mulberrytech dot com
- Organization: Jeni Tennison Consulting Ltd
- References: <20010112084218.324D91D53F@physalis.www.easynet.net>
- Reply-To: xsl-list at lists dot mulberrytech dot com
Hi Bill,
> How do I extend the above if I want to return on the CLIENT_ID
> attribute and a SEQ_NBR Attribute on the element
> CLIENT_ADDRESS_COMPOSITE.
You can do this by making the key hold key values that are
combinations of the CLIENT_ID and SEQ_NBR attributes. The usual way
of doing this is through the concat() function:
<xsl:key name="giveCompositeAddressDetails"
match="CLIENT_ADDRESS_COMPOSITE"
use="concat(@CLIENT_ID, ' ', @SEQ_NBR)"/>
<xsl:variable name="GiveCompositeDetails"
select="key('giveCompositeAddressDetails',
concat($GiveClientDetails/@CLIENT_ID, ' ',
$GiveClientDetails/@SEQ_NBR))"/>
Naturally, you should use a separator that doesn't appear in the
@CLIENT_ID to ensure that the @CLIENT_ID and @SEQ_NBR don't combine in
non-unique ways.
I hope that helps,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list