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 » Problem while referencing fields

Post new topic  Reply to topic
 Problem while referencing fields « View previous topic :: View next topic » 
Author Message
Surya123
PostPosted: Tue Jan 27, 2004 9:41 am    Post subject: Problem while referencing fields Reply with quote

Newbie

Joined: 27 Jan 2004
Posts: 5

Hello-
I am unable to anonymously reference xml fields using ESQL. The xml structure is as follows-

<top>
|_<ctarea>
. |_<childx>
.
|_<data>
|_<childy>
....

I am using Root.xml.*[1].data.*[1] to access "childy" element but somehow it errored out. Please let me know if I am doing anything wrong. Thanks.

Surya
Back to top
View user's profile Send private message
Missam
PostPosted: Tue Jan 27, 2004 10:22 am    Post subject: Reply with quote

Chevalier

Joined: 16 Oct 2003
Posts: 424

Use
Root.XML.*[LAST].data.*[1] to access childy

because the last field of XML will be your actual message body
Back to top
View user's profile Send private message
Surya123
PostPosted: Tue Jan 27, 2004 2:30 pm    Post subject: Reply with quote

Newbie

Joined: 27 Jan 2004
Posts: 5

-
I don't think that's the way the parser works. Actually Root.*[LAST] will give the body. Any other suggestions ?.. Thanks.

Surya
Back to top
View user's profile Send private message
mgk
PostPosted: Wed Jan 28, 2004 12:57 am    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1642

You syntax may not be working because of white space elements in the XML input tree (caused by the presence of CRLF's, blank lines, spaces etc in the input message). To see if this is the case, trace ${ROOT} in a trace node.

However the best way to do anonymous tree navigation is with Reference variables. I suggest you look up the syntax for these (DECLARE REFERENCE TO... , MOVE, LASTMOVE and friends)

Cheers,
_________________
MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
Back to top
View user's profile Send private message
Surya123
PostPosted: Wed Jan 28, 2004 9:43 am    Post subject: Reply with quote

Newbie

Joined: 27 Jan 2004
Posts: 5

When I traced the Root I don't see any spaces. Also, I am able to access the element (childy) using "Root.xml.*[1].data.childy". So I don't think white spaces might be a problem right. Thanks.

Surya
Back to top
View user's profile Send private message
EddieA
PostPosted: Wed Jan 28, 2004 12:44 pm    Post subject: Reply with quote

Jedi

Joined: 28 Jun 2001
Posts: 2453
Location: Los Angeles

What mgk was referring to were extra 'elements' in the tree caused by spaces and CRs. Not additional spaces in the tag name or value.

If you DO have these 'additional' elements, then using 'childy' WILL work, but '*[1]' will NOT.

Cheers,
_________________
Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0
Back to top
View user's profile Send private message
Surya123
PostPosted: Sat Jan 31, 2004 11:52 pm    Post subject: Reply with quote

Newbie

Joined: 27 Jan 2004
Posts: 5

Thanks mgk and EddieA
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 » Problem while referencing fields
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.