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 » DETACH ELEMENTS?

Post new topic  Reply to topic
 DETACH ELEMENTS? « View previous topic :: View next topic » 
Author Message
WBIBB
PostPosted: Thu Oct 09, 2003 5:17 am    Post subject: DETACH ELEMENTS? Reply with quote

Novice

Joined: 24 Jul 2003
Posts: 19

Hi,

How I can detach only the children <xxx>,<yyy> and attach or move it as last child under <cde> within the same parent <abc>.

I/P XML
Code:

 <abc>
   <xxx>21</xxx>
   <yyy>22</yyy>
   <cde>
       <efg>
            <* please do not use *>23</* please do not use *>
            <aaa_vvv>25</aaa_vvv>
            <bbb_yyy>26</bbb_yyy>
            <ccc>27</ccc>
       </efg>
    </cde>
 </abc>


O/P XML

Code:

    <cde>
       <efg>
            <* please do not use *>23</* please do not use *>
            <aaa_vvv>25</aaa_vvv>
            <bbb_yyy>26</bbb_yyy>
            <ccc>27</ccc>
        </efg>
        <abc>
             <xxx>21</xxx>
             <yyy>22</yyy>
         </abc>
   </cde>


Regards
Mike
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Thu Oct 09, 2003 5:54 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Create a compute node. Set it to copy headers.
Code:
Set OutputRoot.XML.cde.efg = InputRoot.XML.abc.cde.efg;
Set OutputRoot.XML.cde.abc.xxx = InputRoot.XML.abc.xxx;
Set OutputRoot.XML.cde.abc.yyy = InputRoot.XML.abc.yyy;

_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
WBIBB
PostPosted: Thu Oct 09, 2003 12:15 pm    Post subject: Reply with quote

Novice

Joined: 24 Jul 2003
Posts: 19

Hi Jeff,

Thanks for your reply.However I would like to navigate the children under <abc> anonymously since there might be be multiple children.

I have used the below code and not sure what I am doing wrong since there is nuttin written at output???

Set OutputRoot = InputRoot;

Code:

DECLARE outref  REFERENCE TO OutputRoot.XML.abc.xxx;
WHILE LASTMOVE(outref)= TRUE  DO
  DETACH outref;
  ATTACH outref TO OutputRoot.XML.cde.abc AS LASTCHILD;
  MOVE outref NEXTSIBLING;
END WHILE;


Regards
Mike
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 » DETACH ELEMENTS?
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.