RE: [xsl] combining the children of similar nodes under one node

Subject: RE: [xsl] combining the children of similar nodes under one node
From: "Andreas L. Delmelle" <a_l.delmelle@xxxxxxxxxx>
Date: Sun, 7 Mar 2004 20:47:06 +0100
> -----Original Message-----
> From: Andreas L. Delmelle
> > -----Original Message-----
> > From: David Montalvo
> >
> > Thanks Andreas. I'll give it a try. Is that method you suggested known
> > as the Meunchian method? I remember reading about it somewhere...
>
> Indeed it is.
>

Just in case you want a bit more explanation WRT the workings of this
method:

The two keys are used mainly to compare the id of the first node returned by
them for a given lookup-value, with the node being selected/processed. The
definition of the first variable is an example of this. It gets to contain
one product node for each of the different product names in the source file.
The prod-by-name key is then used a second time in the product-merge
template, to grab all nodes with the same name as the selected node from the
distinct-prods variable. In product-list template finally, all style or type
nodes are selected in a way similar to the construction of the
distinct-prods variable (comparing id with the first node returned by the
key for the given lookup-value).

The only thing I wasn't sure about:
In this case, when there are more than one style/type nodes with the same
value for a given product name, the first one in source document order will
be the one that's preserved...


Cheers,

Andreas


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread