This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Grouping and conditional info questions


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]