[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] key with many uses's
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
|
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
|