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 » Unique XML to Repeating XML

Post new topic  Reply to topic
 Unique XML to Repeating XML « View previous topic :: View next topic » 
Author Message
KSkelton
PostPosted: Tue Jul 22, 2003 5:53 am    Post subject: Unique XML to Repeating XML Reply with quote

Apprentice

Joined: 28 Oct 2001
Posts: 45

WMQI 2.1

Is there any easy way to convert unique XML tags into a repeating structure?

<block><field1> data </field1></block>
<block><field2> data </field2></block>
<block><field3> data </field3></block>

converted to

<block>
<field> data </field>
<field> data </field>
<field> data </field>
</block>
Back to top
View user's profile Send private message Visit poster's website
jefflowrey
PostPosted: Tue Jul 22, 2003 6:27 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Yes, you should be able to code this with a select. See the ESQL reference manual for more help.
Back to top
View user's profile Send private message
KSkelton
PostPosted: Tue Jul 22, 2003 9:17 am    Post subject: Reply with quote

Apprentice

Joined: 28 Oct 2001
Posts: 45

Jeff,

Thanks, but I do not see how a select will help.
I need to reference the various field names and change them into a single field name. All of the select logic (in the manual) refers to a single field name to begin with.

Is there a way to anonymously reference an unknown number of fields?
See xml above...
Back to top
View user's profile Send private message Visit poster's website
KSkelton
PostPosted: Tue Jul 22, 2003 1:06 pm    Post subject: Reply with quote

Apprentice

Joined: 28 Oct 2001
Posts: 45

Well I figured out the following using the .*[] anonymous reference.

Wish there was a better way because now I have to figure out just how many of the anonymous fields there are and what their staring position (loopcount) is going be.


declare loopcount integer;
set loopcount = 3;
declare outcount integer;
set outcount = 1;

while outcount <= 3 DO
SET OutputRoot.XML.OUT.BLOCK.FIELD[outcount] = coalesce(InputRoot.XML.IN.*[loopcount],'');
SET loopcount = loopcount + 1;
SET outcount = outcount + 1;
end while;
Back to top
View user's profile Send private message Visit poster's website
jefflowrey
PostPosted: Tue Jul 22, 2003 1:55 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

KSkelton wrote:
Jeff,

Thanks, but I do not see how a select will help.
I need to reference the various field names and change them into a single field name. All of the select logic (in the manual) refers to a single field name to begin with.


Something vaguely like
Code:
set OutputRoot.XML.OUT.BLOCK[] = (Select X.(XML.Content).* as FIELD from InputRoot.XML.BLOCK as X where X.(XML.Element) like 'field%');
I think the ESQL Reference guide has some specific examples of doing exactly the kind of transformation you're looking to do.
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 » Unique XML to Repeating XML
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.