This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Grouping and conditional info questions
- To: "'xsl-list at lists dot mulberrytech dot com'" <xsl-list at lists dot mulberrytech dot com>
- Subject: [xsl] Grouping and conditional info questions
- From: Ying Qin <yqin at portal dot com>
- Date: Fri, 24 Aug 2001 16:15:19 -0700
- Reply-To: xsl-list at lists dot mulberrytech dot com
Hi,
Given an XML feed as follows,
...
<item>
<id>1</id>
<name>aaa</name>
...
</item>
<item>
<id>2</id>
<name>ccc</name>
...
</item>
<item>
<id>1</id>
<name>bbb</name>
...
</item>
<item>
<id>2</id>
<name>ddd</name>
...
</item>
How can I group the item elements by their id? Also, can I add a group
title for each group (not every item)? Expected result is,
<group>
<title>Group A</title>
<item>
<id>1</id>
<name>aaa</name>
...
</item>
<item>
<id>1</id>
<name>bbb</name>
...
</item>
</group>
<group>
<title>Group B</title>
<item>
<id>2</id>
<name>ccc</name>
...
</item>
<item>
<id>2</id>
<name>ddd</name>
...
</item>
</group>
Thanks,
Ying.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list