xsl-list
[Top] [All Lists]

Re: [xsl] many-to-many

2007-01-30 01:21:06
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(_dot_)klyne(_at_)groupbc(_dot_)com
www.groupbc.com

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>