W3C home > Mailing lists > Public > www-forms@w3.org > September 2005

Re: How to group some records by a specific value

From: Swithun Crowe <swithun@swithun.servebeer.com>
Date: Fri, 30 Sep 2005 09:57:43 +0100 (BST)
To: Catherine Poinsignon <catherine.poinsignon@lombard.lu>
cc: www-forms@w3.org
Message-ID: <Pine.LNX.4.61.0509300944460.7409@meshach.swithun.servebeer.com>

If your data is sorted, as it is below, then it is probably not too
difficult with a nested repeat along the lines of:

  <xf:output ref="type"/>
    <xf:output ref="."/>

The first repeat finds all the records where the type element is not the
same as the following record. Then the second repeat uses the value of
type to find all names in records which have this type.

It only works when the records are grouped by type, otherwise you will get
the same type being used several times.

Something like this should work.


On Fri, 30 Sep 2005, Catherine Poinsignon wrote:

> Hi all,
> I have some instance data that looks like this for input of an xforms:
> <xforms:instance id="mydata">
> <data>    <record><name>name1</name><type>A</type></record>
I would like to obtain a result like :Type A            name1
name2            name3Type B            name4            name5Type C
name6            name7 I think it is possible using a repeat, but I don't
know how.Could you please help me ? Tanks in advance, Catherine>
Received on Friday, 30 September 2005 08:57:49 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:36:15 UTC