[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] How to sort this xml out


Subject: [xsl] How to sort this xml out
From: "Sri ni" <srini75@xxxxxxxxxxx>
Date: Wed, 09 May 2001 14:08:34 -0000

All,

Please have a look on the following XML and XSL File.

I want to sort all the replies which previousID == a messageID and to group them under an tag called <content>

<?xml version="1.0" encoding="UTF-8"?>
<Main>
	<Message>
		<id>15</id>
		<parentID>0</parentID>
		<title>Title</title>
	</Message>
	<Message>
		<id>17</id>
		<parentID>0</parentID>
		<title>Second Title</title>
	</Message>
	<Reply>
		<id>16</id>
		<parentID>15</parentID>
		<title>first ReplyTitle</title>
	</Reply>

	<Reply>
		<id>18</id>
		<parentID>15</parentID>
		<title>Reply SecondTitle</title>
	</Reply>
</Main>


I tried grouping them with the "key" tag as described in this list, but of no success cany anyone please letme know how to do this??.


I want the output to be as follows:

<?xml version="1.0" encoding="UTF-8"?>
<Main>
	<Content>
		<id>15</id>
		<parentID>0</parentID>
		<title>Title</title>

		<id>16</id>
		<parentID>15</parentID>
		<title>first ReplyTitle</title>

		<id>18</id>
		<parentID>15</parentID>
		<title>Reply SecondTitle</title>
	</Content>

	<Message>
		<id>17</id>
		<parentID>0</parentID>
		<title>Second Title</title>
	</Message>
</Main>

can anyone help me??
Srini
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


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




Current Thread
Keywords