ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Sorting of XML elements based on Date.

Post new topic  Reply to topic
 Sorting of XML elements based on Date. « View previous topic :: View next topic » 
Author Message
RAJESHRAMAKRISHNAN
PostPosted: Tue Sep 07, 2004 3:27 am    Post subject: Sorting of XML elements based on Date. Reply with quote

Voyager

Joined: 01 May 2004
Posts: 96

I have a XML doc like this

<root>
<Tag>
<startDate>2004-08-09T00:00:00</startDate>
<Tag>
<Tag>
<startDate>2004-07-08T00:00:00</startDate>
<Tag>
<Tag>
<startDate>2004-06-08T00:00:00</startDate>
<Tag>
</root>
Tag can accur many times
Now I want to split this message as .
Message1:
<root>
<Tag>
<startDate>2004-06-08T00:00:00</startDate>
<Tag>
</root>

Message2:
<root>
<Tag>
<startDate>2004-07-08T00:00:00</startDate>
<Tag>
</root>

Message3:
<root>
<Tag>
<startDate>2004-08-09T00:00:00</startDate>
<Tag>
</root>

Please note that the order of the message split is based on the startDate. Is it possible to do this using Select ? or do we need to sort this manually.

Thanks
Rajesh
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Sep 07, 2004 5:13 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

ESQL Select doesn't support ORDER BY clause.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
RAJESHRAMAKRISHNAN
PostPosted: Wed Sep 08, 2004 5:01 am    Post subject: Reply with quote

Voyager

Joined: 01 May 2004
Posts: 96

Is it advisible to use the column function MIN or MAX to select the minimum or maximum startDate from XML . The time format is like this
2004-10-04T00:00:00.
Back to top
View user's profile Send private message
PGoodhart
PostPosted: Wed Sep 08, 2004 5:09 am    Post subject: Reply with quote

Master

Joined: 17 Jun 2004
Posts: 278
Location: Harrisburg PA

Why do you care what order the messages get put out in? You can build a fairly simple select and loop to accomplish what you need, if the order is just whatever is in the XML.
_________________
Patrick Goodhart
MQ Admin/Web Developer/Consultant
WebSphere Application Server Admin
Back to top
View user's profile Send private message
RAJESHRAMAKRISHNAN
PostPosted: Wed Sep 08, 2004 7:45 am    Post subject: Reply with quote

Voyager

Joined: 01 May 2004
Posts: 96

The problem is messages should be in the order of the date. ie sequence is important.
Back to top
View user's profile Send private message
JLRowe
PostPosted: Wed Sep 08, 2004 8:10 am    Post subject: Reply with quote

Yatiri

Joined: 25 May 2002
Posts: 664
Location: South East London

You will have to perform the sort yourself.

Probably the easiest way is to use an XSLT node, XSLT allows you to sort the output:

http://www.w3schools.com/xsl/xsl_sort.asp
Back to top
View user's profile Send private message Send e-mail
RAJESHRAMAKRISHNAN
PostPosted: Tue Sep 21, 2004 3:21 am    Post subject: Reply with quote

Voyager

Joined: 01 May 2004
Posts: 96

Hi All,
Thanks very much.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Sorting of XML elements based on Date.
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.