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 » Anonymous field references

Post new topic  Reply to topic
 Anonymous field references « View previous topic :: View next topic » 
Author Message
mq_pm
PostPosted: Fri May 14, 2004 6:21 am    Post subject: Anonymous field references Reply with quote

Centurion

Joined: 27 Aug 2003
Posts: 132

Hi,

I have an xml message:

<Request>
<reqInfo>
<NumberValidRQ xmlns="......" xmlns:xsi="......" TimeStamp="..." EchoToken="" SequenceNmbr="0000" xsi:schemaLocation="....." Target="Production" Version="1">


I need to access sequencenmbr. For all messages the format is same except NumberValidRQ will change. I don't want it to be hard coded one.

So I tried to access sequence number as:

InputRoot.XML.Request.reqinfo.*[1].*[5]
InputRoot.XML.Request.reqinfo.*[1].(XML.attr)SequenceNmbr

But the value I get is null. Tried all options.


A/c to ESQL 2.1 ,
It is possible to refer to the array of all children of a particular entity by using a path element of "*". So, for example:
InputRoot.*[] is a path that identifies the array of all children of InputRoot.


Can anyone tell me how to refer to that value.

Thanks.
Back to top
View user's profile Send private message Send e-mail
mq_pm
PostPosted: Fri May 14, 2004 7:00 am    Post subject: urgent Reply with quote

Centurion

Joined: 27 Aug 2003
Posts: 132

sorry it was

"InputRoot"."XML"."Request"."reqinfo".*[1].*[5]
"InputRoot."XML"."Request"."reqinfo".*[1].(XML.attr)SequenceNmbr


Any help is appreciated. Thanks.
Back to top
View user's profile Send private message Send e-mail
JT
PostPosted: Fri May 14, 2004 10:42 am    Post subject: Reply with quote

Padawan

Joined: 27 Mar 2003
Posts: 1564
Location: Hartford, CT.

Quote:
<Request>
<reqInfo>
<NumberValidRQ xmlns="......" xmlns:xsi="......" TimeStamp="..." EchoToken="" SequenceNmbr="0000" xsi:schemaLocation="....." Target="Production" Version="1">

Quote:
"InputRoot"."XML"."Request"."reqinfo".*[1].*[5]
"InputRoot."XML"."Request"."reqinfo".*[1].(XML.attr)SequenceNmbr

reqinfo/reqInfo, pick one or the other, not both.
Back to top
View user's profile Send private message
mq_pm
PostPosted: Fri May 14, 2004 11:18 am    Post subject: Reply with quote

Centurion

Joined: 27 Aug 2003
Posts: 132

I used only one. But neither one gave me correct value. I was trying to say that I used these two options.

I tried using MOVE operation. still not able to solve the problem.

DECLARE PATH REFERENCE TO "InputRoot"."XML"."Request"."reqInfo";
MOVE PATH FIRSTCHILD ;

SET Y = PATH.(XML.attr)SequenceNmbr ;

Is this correct???
Back to top
View user's profile Send private message Send e-mail
JT
PostPosted: Fri May 14, 2004 11:31 am    Post subject: Reply with quote

Padawan

Joined: 27 Mar 2003
Posts: 1564
Location: Hartford, CT.

Apparently I wasn't clear. In both of your statements you reference reqinfo (lowercase i), but your XML message has reqInfo (upppercase I). Your statement should reference reqInfo, not reqinfo.
Back to top
View user's profile Send private message
mq_pm
PostPosted: Fri May 14, 2004 11:40 am    Post subject: Reply with quote

Centurion

Joined: 27 Aug 2003
Posts: 132

It is reqInfo. Sorry i typed it has wrong here. But in the code i mentioned reqInfo only. So you mean the syntax is correct to access the attribute???
Back to top
View user's profile Send private message Send e-mail
JT
PostPosted: Fri May 14, 2004 12:10 pm    Post subject: Reply with quote

Padawan

Joined: 27 Mar 2003
Posts: 1564
Location: Hartford, CT.

Code:
DECLARE cursor REFERENCE TO InputRoot.XML."Request"."reqInfo".*[1].(XML.Attribute)"SequenceNmbr";
SET OutputRoot.XML."soap:Envelope"."soap:Body"."Name"."Number" = FIELDVALUE(cursor);

The preceding code creates the output XML element Number that contains the value of the SequenceNmbr attribute:

Code:
  (0x01000010):XML        = (
    (0x01000000):soap:Envelope = (
      (0x01000000):soap:Body = (
        (0x01000000):Name = (
          (0x01000000):Number = (
            (0x02000000): = '0000'
          )
        )
      )
    )
  )


Good luck !
Back to top
View user's profile Send private message
JT
PostPosted: Fri May 14, 2004 12:45 pm    Post subject: Reply with quote

Padawan

Joined: 27 Mar 2003
Posts: 1564
Location: Hartford, CT.

Ooops, my bad. There's another recent posting that is similar to yours relating to XML attribute values. The following code produces a value of "0000" for the variable Y.
Code:
SET Y = InputRoot.XML."Request"."reqInfo".*[1].(XML.Attribute)"SequenceNmbr";
Yes, your code is also correct:
Quote:
DECLARE PATH REFERENCE TO "InputRoot"."XML"."Request"."reqInfo";
MOVE PATH FIRSTCHILD ;

SET Y = PATH.(XML.attr)SequenceNmbr ;

Is this correct???
Back to top
View user's profile Send private message
kspranava
PostPosted: Mon May 17, 2004 2:12 am    Post subject: xml.element Reply with quote

Centurion

Joined: 27 Apr 2003
Posts: 124

Hi mq_pm,

Why don't you try the following code,

InputRoot.XML.Request.reqInfo.(XML.Element).(XML.attr)SequenceNmbr

This will work not only for "NumberValidRQ" but for all.

Pranava.
Back to top
View user's profile Send private message
mq_pm
PostPosted: Mon May 17, 2004 6:52 am    Post subject: Reply with quote

Centurion

Joined: 27 Aug 2003
Posts: 132

Hi Pranava,

Thanx alot....it worked
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Anonymous field references
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.