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 » How to add XML Tag

Post new topic  Reply to topic
 How to add XML Tag « View previous topic :: View next topic » 
Author Message
dsmq
PostPosted: Tue Jul 01, 2003 10:34 am    Post subject: How to add XML Tag Reply with quote

Acolyte

Joined: 20 Jun 2002
Posts: 59

Hi

I have Following XML

<CreateRQ Token = '9999' SeqNmbr = '1000'>
<ActionCode>nc</ActionCode>
<Station>8001</Station>
</CreateRQ>

Now i want add a tag <Status> after createRQ, How do i add <Status> as XML Element.

my output XML Should be

<CreateRQ Token = '9999' SeqNmbr = '1000'>
<Status>Success<Status>
<ActionCode>nc</ActionCode>
<Station>8001</Station>
</CreateRQ>

while adding How do we specify XML element or XML attribute

Thanks
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Jul 01, 2003 10:59 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Code:
set OutputRoot.XML.CreateRQ.Status = 'Status';
will create a new field as a child of CreateRQ with the value of 'Status'.

For setting XML Attributes, there's an appendix in the Programming guide that will tell you how to address any different type of XML field from ESQL.
Back to top
View user's profile Send private message
Craig B
PostPosted: Tue Jul 01, 2003 11:52 pm    Post subject: Reply with quote

Partisan

Joined: 18 Jun 2003
Posts: 316
Location: UK

When using the SET statement to add a message tree field, then this will be added as the last child. So in the example given above, the Status field will be created as the last child of CreateRQ which means that it will appear after Station. To create the Status field as the first child in the list then you would need something like the following :

Code:

SET OutputRoot = InputRoot;
DECLARE createRef REFERENCE TO OutputRoot.XML.CreateRQ;
CREATE FIRSTCHILD OF createRef NAME Status VALUE 'SUCCESS';


With attributes being children of CreateRQ then you may need to add the TYPE clause to the CREATE statement using the types indicated in the previous append.

But since the default for the XML parser is a tag, then this should give you what you require.
_________________
Regards
Craig
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 » How to add XML Tag
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.