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 » Adding XML attribute to XML tag in JCN

Post new topic  Reply to topic
 Adding XML attribute to XML tag in JCN « View previous topic :: View next topic » 
Author Message
SivaKrishna
PostPosted: Fri Jul 22, 2016 12:41 am    Post subject: Adding XML attribute to XML tag in JCN Reply with quote

Newbie

Joined: 16 Feb 2016
Posts: 2

Hi,

need some quick help on how to add xml attribute to a xml tag in JCN..

<ns:WOACTIVITY action = 'Add'>
some text
<ns:WOACTIVITY>

Where action = 'Add' is the one I should add.

Thanks for the help in advance[/b]
Back to top
View user's profile Send private message
timber
PostPosted: Fri Jul 22, 2016 1:05 am    Post subject: Reply with quote

Grand Master

Joined: 25 Aug 2015
Posts: 1280

The following code is completely untested, and probably will not compile but you should get the idea:
Code:
MbElement outputBody= root.getLastChild().getFirstChild();
MbElement WOACTIVITY = outputBody.createElementAsLastChild(MbElement.TYPE_NAME,"WOACTIVITY",null);
WOACTIVITY.setNamespace('myNamespaceURL');
MBElement actionAttr = WOACTIVITY.createElementAsLastChild(MbXMLNSC.ATTRIBUTE,"Action","Add");
Back to top
View user's profile Send private message
SivaKrishna
PostPosted: Fri Jul 22, 2016 4:24 am    Post subject: Reply with quote

Newbie

Joined: 16 Feb 2016
Posts: 2

Thank you it worked..thank you 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 » Adding XML attribute to XML tag in JCN
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.