[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

How to sort this xml out

Subject: How to sort this xml out
From: "Sri ni" <srini75@xxxxxxxxxxx>
Date: Wed, 09 May 2001 14:08:34 -0000
xml id parentid
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.