|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Muenchian Method
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
|
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








