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 » Dynamically getting the Field Name

Post new topic  Reply to topic
 Dynamically getting the Field Name « View previous topic :: View next topic » 
Author Message
sahas
PostPosted: Tue Apr 11, 2006 8:44 am    Post subject: Dynamically getting the Field Name Reply with quote

Newbie

Joined: 11 Apr 2006
Posts: 4

Hi,

I am facing a problem when getting the Field Name of 'Company' dynamically.
Below is the code for which I am using in ESQL.

DECLARE myRef REFERENCE TO InputRoot."XML";
MOVE myRef FIRSTCHILD;
SET OutputRoot.XML.Company.Temp = FIELDNAME(myRef);

Below is the Sample XML:

<?xml version="1.0" encoding="UTF-8"?><Company><EmpNo>123454</EmpNo><Action>Create</Action></Company>

When I put the message <Company><EmpNo>123454</EmpNo><Action>Create</Action></Company>

its giving the correct output, but when I include the first line XML tag its giving an error.

Can anyone please help me out.
Back to top
View user's profile Send private message
wschutz
PostPosted: Tue Apr 11, 2006 9:07 am    Post subject: Reply with quote

Jedi Knight

Joined: 02 Jun 2005
Posts: 3316
Location: IBM (retired)

Assuming you want myref to point to Company...I would think you'd want to include a TYPE Element on the MOVE command...and you should always test that moves worked with LASTMOVE
_________________
-wayne
Back to top
View user's profile Send private message Send e-mail AIM Address
sanu_mit
PostPosted: Tue Apr 11, 2006 9:20 am    Post subject: Reply with quote

Apprentice

Joined: 03 Jul 2003
Posts: 25
Location: Kolkata

Dear Saha Babu,
Please make the syntax as FIELDNAME(InputRoot.XML.*[1]) or FIELDNAME(InputRoot.XML.(XML.Element)[1]). This will work.

However, if you want to use reference pointer please refer it first at least until the root level of the message. The it will work.

You could have declared the reference as
DECLARE myRef REFERENCE TO InputRoot.XML.*[1];

Enjoy programming....
----------------------------------------
Santa
Back to top
View user's profile Send private message 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 » Dynamically getting the Field Name
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.