[xsl] Re: Problem with Muenchian grouping

Subject: [xsl] Re: Problem with Muenchian grouping
From: "Dimitre Novatchev" <dnovatchev@xxxxxxxxx>
Date: Mon, 10 Nov 2003 19:25:53 +0100
> I group elements that have an <action> child by name and then for each
group I
> build an HTML table. Members of the same group usually have the same set
of
> childnodes, but this is not always the case, and this is a problem, given
the
> way I build the tables: I get the first member of the group and set the
> headers of the table to the names of its children (<th align="center"
> bgColor="lightgrey"><xsl:value-of select="name()"/> </th>). When other
members
> of the group have more children, the values of those latter are put in a
new
> column without header...
>
> So, instead of getting the first member of the group, I would like to get
the
> one with the greatest number of children (to get all the headers, it's not
a
> problem if some fields are blank in the table). Is this possible?

This is possible, but you have a wrong idea about the problem. Even if you
use the element with biggest number of children, there might be other
elements in the same group that have children, whose name will not be
represented in the column header.

What you really need is all different names of all children of all elements
in a group.

This is nested grouping and has a standard solution using the same Muenchian
method.

Please, give a minimal complete example of a source xml document and many
people in this group will be glad to provide the solution.


=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL





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


Current Thread