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

Re: Joining xml documents on the fly

Subject: Re: Joining xml documents on the fly
From: Joelle Tegwen <tegwe002@xxxxxxx>
Date: Mon, 08 Jun 2009 10:47:25 -0500
Re:  Joining xml documents on the fly
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

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-2011 All Rights Reserved.