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

Re: Muenchian Method

Subject: Re: Muenchian Method
From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx>
Date: Fri, 3 Aug 2001 15:16:37 +0100
surname names members
Hi Doug,

> I would like to group an XML file so the HTML would be like this:

Your XSLT is almost there. The only problem is that the path you're
using in the use attribute of xsl:key (and later, when you try to get
unique nodes) isn't correct. Your key is:

<xsl:key name="contacts-by-surname" match="member" use="last_name" />

But you the last_name element isn't a direct child of the member
element - you should be stepping down through the name element, i.e.:

<xsl:key name="contacts-by-surname" match="member"
         use="name/last_name" />
              ^^^^^

Similarly, when you select the unique members, you need to use a path
that takes you from the member element to the last_name element, i.e.:

  member[count(.|key('contacts-by-surname', name/last_name)[1]) = 1]
                                            ^^^^^

In the final use of the key, you got the path right, but added quotes
around it, so it's trying to find members with the surname
"name/last_name", which I doubt anyone has. There, again, you need:

  key('contacts-by-surname', name/last_name)

I hope that helps,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


 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.