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 access element name dynamically?

Post new topic  Reply to topic
 How to access element name dynamically? « View previous topic :: View next topic » 
Author Message
bab
PostPosted: Fri Jul 15, 2016 2:18 am    Post subject: How to access element name dynamically? Reply with quote

Novice

Joined: 05 Jul 2016
Posts: 17

Hi i am new to IIB.

I want to get element tag name dynamically. I dont know how to do that.

I am having the following input :

<emp><name>john</name><salary>30000</salary></emp>

In the above input, i want to get the child names of <emp> root tag , ie. name and salary.

Please help me. Thanks in advance...
Back to top
View user's profile Send private message
mqjeff
PostPosted: Fri Jul 15, 2016 4:08 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

This is an IIB question, so it should hopefully be locked if it's duplicated or moved to the IIB forum if not.

DO NOT TAKE ACTION ON THIS, bab.

The answer to your question is "use reference messages". If you're using ESQL.

Otherwise use the related options in whatever transformation node you're using.
_________________
chmod -R ugo-wx /
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Fri Jul 15, 2016 5:01 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

mqjeff wrote:
This is an IIB question, so it should hopefully be locked if it's duplicated or moved to the IIB forum if not.

DO NOT TAKE ACTION ON THIS, bab.

The answer to your question is "use reference messages". If you're using ESQL.

Otherwise use the related options in whatever transformation node you're using.

Jeff might not have been clear enough:
Use a reference.
ESQL
Code:
declare xyz REFERENCE TO ....emp;
MOVE xyz FIRSTCHILD TYPE <parsername>.<type>;
SET fname = FIELDNAME(xyz);


With that you have the base and should be able to find the corresponding references in the infocenter.
Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
timber
PostPosted: Fri Jul 15, 2016 10:58 am    Post subject: Reply with quote

Grand Master

Joined: 25 Aug 2015
Posts: 1292

This (not tested, probably broken) loop will get the name of each first-level child tag of <emp>:
Code:

DECLARE childRef REFERENCE TO InputRoot.XMLNSC.emp.(XMLNSC.Element)*[1];
WHILE LASTMOVE(xyz) DO
  DECLARE fname FIELDNAME(childRef);
  -- Do something with fname. But what?!

  MOVE childRef NEXTSIBLING;
END IF;

However, it seems like a strange requirement for a message flow. What problem are you trying to solve?
Back to top
View user's profile Send private message
bab
PostPosted: Thu Aug 04, 2016 3:22 am    Post subject: Thanks for all your replies. Reply with quote

Novice

Joined: 05 Jul 2016
Posts: 17

Thanks for all your replies.
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 access element name dynamically?
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.