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

Re: many-to-many

Subject: Re: many-to-many
From: Ronan Klyne <ronan.klyne@xxxxxxxxxxx>
Date: Tue, 30 Jan 2007 08:16:50 +0000
Re:  many-to-many
Brown, William S wrote:
> Quite a bit cleaner than any example I was able to find on the web
> (but maybe I was looking in the wrong places).

I've always found it difficult to find the right search terms to find
what you want when dealing with XSL...

> I haven't figured out yet how the 'part' template works yet

What it does is give a list of invoices on which a particular part appears.
How it does it is by use of the 'p-i' key, which matches each invoice,
keyed by the part ids of all parts on that invoice (use='part/@id')
Is this clear?

> I don't see how I would output elements (e.g., partLoc below) along with the part id.
> It's simple, right? (ducking qand running)

It could be done easily with a second key to map from part id to part:
<xsl:key name="pid-p" match="/doc/parts/part" use="@id"/>

Then instead of using key('i-p', @id) to in the loop in the invoice
template, get only the part id, you can use key('pid-p', key('i-p',
@id)/@id) to get the part, which you can then do what you like with,
including get the child nodes (partLoc).

This is just one solution, and almost certainly not the best; I could
not figure out a way of having the key 'i-p' give the fuller part
details. Ideas anyone?


-- 
Ronan Klyne
Business Collaborator Developer
Tel: +44 (0)870 163 2555
ronan.klyne@xxxxxxxxxxx
www.groupbc.com

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.