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 » Copying MBELEMENT using copyElementTree

Post new topic  Reply to topic
 Copying MBELEMENT using copyElementTree « View previous topic :: View next topic » 
Author Message
NAIDU
PostPosted: Wed May 24, 2017 12:00 am    Post subject: Copying MBELEMENT using copyElementTree Reply with quote

Novice

Joined: 12 Jan 2016
Posts: 17

Hi Team ,
I am not able to copy copyelementTree twice. when i am doing second copyelementtree then it is overriding the first copyelementtree.

MY payload

<Root>
<Parent>
<child1> 1 </child1>
<child2> 2 </child2>
<child3> 3 </child3>
</parent>
<Parent2>
<child21> 21 </child21>
<child22> 22 </child22>
<child23> 23 </child23>
<Childparent>
<c1>a </c1>
<c2>b</c2>
</Childparent>
</parent2>
<Parent3>
<child31> 321 </child31>
<child32> 322 </child32>
<child33> 323 </child33>
</parent3>



</Root>



expected output

<Root>
<child1> 1 </child1>
<child2> 2 </child2>
<child3> 3 </child3>
<child21> 21 </child21>
<child22> 22 </child22>
<child23> 23 </child23>
<Childparent>
<c1>a </c1>
<c2>b</c2>
</Childparent>
<child31> 321 </child31>
<child32> 322 </child32>
<child33> 323 </child33>
</Root>



Here child are many .. i just wanted to copyelementtree twice.

thanks in advance
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed May 24, 2017 3:10 am    Post subject: Reply with quote

Grand High Poobah

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

You might have to append each child of the source... the second time around...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
NAIDU
PostPosted: Wed May 24, 2017 3:18 am    Post subject: Reply with quote

Novice

Joined: 12 Jan 2016
Posts: 17

here i am getting 1500 element in each parent. so i wanted copyelementtree approach or other approach which minimize code
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed May 24, 2017 3:27 am    Post subject: Reply with quote

Grand High Poobah

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

NAIDU wrote:
here i am getting 1500 element in each parent. so i wanted copyelementtree approach or other approach which minimize code


I don't follow here. This should be a generic java function where you pass the source MbElement, the target MbElement and it appends all the children using copyelementtree for each child yes?

Coding effort = 1 generic loop ???
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Copying MBELEMENT using copyElementTree
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.