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 » XML Creation using ESQL

Post new topic  Reply to topic
 XML Creation using ESQL « View previous topic :: View next topic » 
Author Message
raana
PostPosted: Sun Jan 15, 2017 10:58 pm    Post subject: XML Creation using ESQL Reply with quote

Newbie

Joined: 15 Jan 2017
Posts: 6

I am an novice IIB developer. Can someone guide me in creating the below xml structure using ESQL.

Input:

<animal>
<animaldomestic>dog<animaldomestic>
<animalwild>cheetah<animalwild>
</animal>
Output:

<animals>
<animal type="domestic">cow</animal>
<animal type="wild">cheetah</animal>
</animals>
Back to top
View user's profile Send private message
smdavies99
PostPosted: Sun Jan 15, 2017 11:14 pm    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

Welcome to this forum.
We do have some rules though.

1) We don't do your job for you. We provide help.
2) We are not a resource you can rely on for a timely response. most of us have our own jobs to do as well.
3) We are not a substitute for getting proper training.
4) WE really appreciate YOU trying things out and helping yourself.

The answer to your problem is available in one or more of the following
1) The samples provided with the Product
2) The product documentation
3) This forum.

Enjoy
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
Deepak.k
PostPosted: Sun Jan 15, 2017 11:14 pm    Post subject: Hi raana Reply with quote

Novice

Joined: 18 Aug 2016
Posts: 22

Go with this link

https://www.ibm.com/support/knowledgecenter/SSKM8N_8.0.0/com.ibm.etools.mft.doc/ac67194_.htm
Back to top
View user's profile Send private message
raana
PostPosted: Mon Jan 16, 2017 12:21 am    Post subject: Reply with quote

Newbie

Joined: 15 Jan 2017
Posts: 6

Thank you deepak.

I have tried the below code:

SET OutputRoot.XMLNSC.animals.animal.(XMLNSC.Attribute)type = 'domestic';
SET OutputRoot.XMLNSC.animals.animal VALUE = InputRoot.XMLNSC.animal.animaldomestic;
SET OutputRoot.XMLNSC.animals.animal.(XMLNSC.Attribute)type = 'wild';
SET OutputRoot.XMLNSC.animals.animal VALUE = InputRoot.XMLNSC.animal.animalwild;

but i got only the below:

<animals>
<animal type="domestic">cow</animal>
<animals>


Last edited by raana on Mon Jan 16, 2017 2:44 am; edited 2 times in total
Back to top
View user's profile Send private message
raana
PostPosted: Mon Jan 16, 2017 12:30 am    Post subject: Reply with quote

Newbie

Joined: 15 Jan 2017
Posts: 6

Thank you guys. I got the desired output.
Back to top
View user's profile Send private message
smdavies99
PostPosted: Mon Jan 16, 2017 2:28 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

Great. Well done.

Why not share the working code so that others can benefit from your learning?
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
raana
PostPosted: Mon Jan 16, 2017 2:32 am    Post subject: Reply with quote

Newbie

Joined: 15 Jan 2017
Posts: 6

Sure davis!!


SET OutputRoot.XMLNSC.animals.animal[1].(XMLNSC.Attribute)type = 'domestic';
SET OutputRoot.XMLNSC.animals.animal[1]VALUE = InputRoot.XMLNSC.animal.animaldomestic;
SET OutputRoot.XMLNSC.animals.animal[2].(XMLNSC.Attribute)type = 'wild';
SET OutputRoot.XMLNSC.animals.animal[2]VALUE = InputRoot.XMLNSC.animal.animalwild;
Back to top
View user's profile Send private message
smdavies99
PostPosted: Mon Jan 16, 2017 7:48 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

Your next lesson should be how to make the code more efficient.
Using indexes beyong 1 or 2 is very inneficient. Also making use of references would help.

Learning to use the formatting options on the bar above the edit box would be useful.
Here is your code inside C O D E tags
Code:

SET OutputRoot.XMLNSC.animals.animal[1].(XMLNSC.Attribute)type = 'domestic';
SET OutputRoot.XMLNSC.animals.animal[1]VALUE = InputRoot.XMLNSC.animal.animaldomestic;
SET OutputRoot.XMLNSC.animals.animal[2].(XMLNSC.Attribute)type = 'wild';
SET OutputRoot.XMLNSC.animals.animal[2]VALUE = InputRoot.XMLNSC.animal.animalwild;


Finally, it is DAVIES not DAVIS. They are two different family names.
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
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 » XML Creation using ESQL
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.