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 » Code for rearranging a XML

Post new topic  Reply to topic
 Code for rearranging a XML « View previous topic :: View next topic » 
Author Message
Debarpan
PostPosted: Fri Jan 09, 2015 4:36 am    Post subject: Code for rearranging a XML Reply with quote

Newbie

Joined: 09 Jan 2015
Posts: 1

Code:
<Containers>
<Container>
<Consignment>1A</Consignment>
<Consignment>1A</Consignment>
<Consignment>1A</Consignment>
</Container>
<Container>
<Consignment>1B</Consignment>
<Consignment>1B</Consignment>
<Consignment>1B</Consignment>
<Consignment>1B</Consignment>
<Consignment>1B</Consignment>
</Container>
<Container>
<Consignment>1C</Consignment>
<Consignment>1C</Consignment>
</Container>
<Container>
<Consignment>1D</Consignment>
<Consignment>1D</Consignment>
<Consignment>1D</Consignment>
<Consignment>1D</Consignment>
<Consignment>1D</Consignment>
</Container>
</Containers>


I have the above XML (Or for similar kind of XML),This is my InputRoot.XMLNSC.*,I just want to make a XML in OutputRoot where this <Container> tag shuold come first who has minimum number of Consignment within it.and in this Ascending way.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Fri Jan 09, 2015 5:29 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

There's absolutely no need that any proigram should require that your XML data be sorted in that way.
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Jan 09, 2015 5:58 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

mqjeff wrote:
There's absolutely no need that any proigram should require that your XML data be sorted in that way.




But you can write some ESQL that searches the InputRoot tree for the <Container> tag with the largest number of children and copies that to the OutputRoot, then the next highest, and so forth.

Which is exactly what the application consuming the XML should be doing if it does in fact need to process the data in that way. This is a daft thing to be doing in WMB and whoever gave you the task needs to be told that.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Fri Jan 09, 2015 6:36 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

School exercise to teach them about manipulation of the message tree???
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Fri Jan 09, 2015 6:48 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

fjb_saper wrote:
School exercise to teach them about manipulation of the message tree???


Gosh, I sure hope their teacher doesn't read MQSeries.net looking for students trying to cheat!
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 » Code for rearranging a XML
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.