[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] Joining xml documents on the fly


Subject: Re: [xsl] Joining xml documents on the fly
From: Joelle Tegwen <tegwe002@xxxxxxx>
Date: Mon, 08 Jun 2009 10:47:25 -0500

This isn't working for me. I get 0 results even when I ask for the first one:
<xsl:key name="p" match="project_staff_role" use="@staff_id"/>
<xsl:variable name="common"
select="$staff_roles[generate-id()=generate-id(key('p',@staff_id)[0])]"/>



I tried playing around with what is going into the generate-id and key functions, but that didn't help.
I'm not sure what's really going on in the above statement. If I don't look at it too carefully I can intuit what's going on, but when I look at it closely it doesn't quite make sense.


generate-id(key('p',@staff_id)[0])] is the most confusing part.

Why the @staff_id in the key but not in the generate_id()? I thought that generate_id produced unique values for each element (in this case staff_id) wouldn't the [0] element just give you the first staff_id? When I think about this I wonder if the [0] goes somewhere else.

I appreciate your time.
Joelle

David Carlisle wrote:
Now I want to find all of the people in <project_staff_roles> who are listed more than, arbitrarily, 5 times.

<xsl:key name="p" match="project_staff_role" use="@staff_id"/> ....


<xsl:for-each select="project_staff_roles/project_staff[generate-id()=generate-id(key('p',@staff_id)[6])">

David

________________________________________________________________________
The Numerical Algorithms Group Ltd is a company registered in England
and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs. ________________________________________________________________________


Current Thread