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 map repeating XML field in input to non repeating in

Post new topic  Reply to topic
 How to map repeating XML field in input to non repeating in « View previous topic :: View next topic » 
Author Message
bmccarty
PostPosted: Wed Apr 10, 2002 10:46 am    Post subject: Reply with quote

Apprentice

Joined: 18 Dec 2001
Posts: 43

If you have any suggestions on this syntax, I would really appreciate it.

I have an input XML message that is pretty typical and has repeating fields that looks something like this:

<Message>
<Person>
<FirstName>Henry</FirstName>
<LastName>Winkler</LastName>
</Person>
<Person>
<FirstName>The</FirstName>
<LastName>Fonz</LastName>
</Person>
</Message>

The output message (not under my control) can't have repeating tags, each XML tag has to be unique. So it would be something like this:

<Message>
<Person>
<FirstName1>Henry</FirstName1>
<LastName1>Winkler</LastName1>
<FirstName2>The</FirstName2>
<LastName2>Fonz</LastName2>
</Person>
</Message>

What is the ESQL syntax to map these together? For the outputroot thus far I have:

Set.OutputRoot.XML.Message.Person.FirstName1 = InputBody.Message.Person.Firstname[1];

That works fine, but it doesn't pass the second occurence:

Set.OutputRoot.XML.Message.Person.FirstName2 = InputBody.Message.Person.Firstname[2];

Obviously I don't understand something about the way the tree is working, but I am not sure what it is I don't know.

Thanks for the help.

B
Back to top
View user's profile Send private message AIM Address MSN Messenger
kirani
PostPosted: Wed Apr 10, 2002 12:43 pm    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

your ESQL is not correct. You should try using something like this,

SET OutputRoot.XML.Message.Person.FirstName1 = InputBody.Message.Person[1].FirstName;
SET OutputRoot.XML.Message.Person.LastName1 = InputBody.Message.Person[1].LastName;
.....
SET OutputRoot.XML.Message.Person.FirstNameN = InputBody.Message.Person[N].FirstName;
SET OutputRoot.XML.Message.Person.LastNameN = InputBody.Message.Person[N].LastName;


But this way you are hardcoding your Attribute Names. You should try using some kind of LOOP and generate Attribute names dynamically. You can make use of EVAL function for doing this.



_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
bmccarty
PostPosted: Wed Apr 10, 2002 1:00 pm    Post subject: Reply with quote

Apprentice

Joined: 18 Dec 2001
Posts: 43

Thanks Kiran for the help, I must have hit my head when I got out of bed this morning.

I have it working with static references now, but I am still trying to figure out how to build the output tag names dynamically. I will investigate the EVAL.

Thanks again.

B
Back to top
View user's profile Send private message AIM Address MSN Messenger
amigupta1978
PostPosted: Thu Apr 11, 2002 12:30 am    Post subject: Reply with quote

Centurion

Joined: 22 Jan 2002
Posts: 132
Location: India

HI,
Which version of WMQI are u using?? If u are using 2.1 then u can try using Create function of ESQL...From which u can craete dynamic name of siblings and i think will have better performance too.. But its only there in MQSI 2.1
otherwise EVAL is the only other option.

Regards,
Amit
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
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 map repeating XML field in input to non repeating in
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.