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

key with many uses's

Subject: key with many uses's
From: Elizabeth Barham <soggytrousers@xxxxxxxxx>
Date: 06 Feb 2002 11:01:11 -0600
key special
Hi,

I have a series of elements that I would like to group based on more
than one parameter.

1. <phone>713-228-XXXX</phone>
2. <phone type="fax">713-228-XXXX</phone>
3. <phone type="special" description="clients" paren="1" description-place="before">713-228-XXXX</phone>
4. <phone type="special" description="AIDS legal hotline:" paren="0" description-place="before">713-528-XXXX</phone>
5. <phone type="special" description="AIDS legal hotline:" paren="0" description-place="before" >800-528-XXXX</phone>

In this example, I'd like to somehow get both 4 and 5 together. I've
considered using three keys:
	
<xsl:key name="special-phone-d" match="phone[@type='special']" use="@description"/>
<xsl:key name="special-phone-p" match="phone[@type='special']" use="@paren"/>
<xsl:key name="special-phone-w" match="phone[@type='special']" use="@description-place"/>

and one key:

<xsl:key name="special-phone" match="phone[@type='special']" use ="@description | @paren | @description-place" />

Using the Muenchian Method it'd be something like this using the three
keys:

<xsl:for-each select="$nodes[generate-id(.)] = generate-id(key('special-phone-d', @description)[1])]
	and
	$nodes[generate-id(.)] = generate-id(key('special-phone-p', @paren)[1])
	and
	$nodes[generate-id(.)] = generate-id(key('special-phone-w', @description-place)[1])">

But from here, how do I get the group? ($nodes is passed in as a
parameter and makes up the phone elements themselves).

Would it be something like:

<xsl:value-of select="key('special-phone-p', @paren) and key('special-phone-d', @description) and key('special-phone-w', @description-place)" />

Thank you for any help! :-)

Elizabeth

 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.