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 » FIND XPATH VALUE

Post new topic  Reply to topic
 FIND XPATH VALUE « View previous topic :: View next topic » 
Author Message
matuwe
PostPosted: Fri Apr 23, 2010 5:14 am    Post subject: FIND XPATH VALUE Reply with quote

Master

Joined: 05 Dec 2007
Posts: 296

Hi,

I need to find a value for an XPATH. I can have about 6 different children for INPUT and need to dynamically build the xpath like the sample code below. Is this possible? and is it OK if I do IS NULL on the if, it seems to be doing a null check on charecter

Code:

DECLARE it CHARACTER '.ESB_DATA';
DECLARE RootEll CHARACTER InputRoot.XMLNS.ESB_WRAPPER.INPUTS. ; --|| it;
      
      IF (RootEll||it IS NOT NULL) THEN
         RETURN TRUE;
      END IF;
Back to top
View user's profile Send private message
raghu1984
PostPosted: Sun May 02, 2010 3:22 am    Post subject: Reply with quote

Newbie

Joined: 10 Dec 2009
Posts: 7

Hi,
Use it this way,
Code:

InputRoot.XMLNS.ESB_WRAPPER.INPUTS.{it};
Back to top
View user's profile Send private message
mqjeff
PostPosted: Sun May 02, 2010 4:51 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

raghu1984 wrote:
Hi,
Use it this way,
Code:

InputRoot.XMLNS.ESB_WRAPPER.INPUTS.{it};


That won't work very well.

There isn't a presupplied method for ESQL to evaluate an XPath expression.
Back to top
View user's profile Send private message
vikashsharma85
PostPosted: Sun May 02, 2010 9:27 pm    Post subject: Reply with quote

Novice

Joined: 19 Mar 2010
Posts: 15

Hi,

You can use EVAL function to evaluate XPATH and Use EXISTS function to check whether the required path exists or not.
Back to top
View user's profile Send private message
matuwe
PostPosted: Fri May 07, 2010 6:27 am    Post subject: Reply with quote

Master

Joined: 05 Dec 2007
Posts: 296

Please help.

It works. But now I hit a problem when I have to search for two level XPATH like what I have on StringFromDATABASE. The problem is I can have more than 2 level XPATH to search for. How can I get my StringFromDATABASE to be rebuild dynamically to be looked up by the IF statement.

Code:

CREATE LASTCHILD OF Environment.Payload DOMAIN ('XMLNS') PARSE (messageString,InputRoot.Properties.Encoding, InputRoot.Properties.CodedCharSetId);
IF Environment.Payload.XMLNS IS NOT NULL THEN
   SET xmlStructureParsed = true;
   SET OutputRoot.XMLNSC.ESB_WRAPPER.INPUTS.INPUTPAYLOAD = Environment.Payload.XMLNS ;
   DECLARE root CHARACTER 'ESB_DATA';
   DECLARE valuedd CHARACTER 'sourceSystem';
   DECLARE StringFromDATABASE CHARACTER 'ESB_DATA/sourceSystem';
WHILE StringFromDATABASE <> NULL DO
   IF OutputRoot.XMLNSC.ESB_WRAPPER.INPUTS.INPUTPAYLOAD.{root}.{valuedd} IS NOT NULL THEN
   SET DataType = ‘ESB_DATA’;
   END IF;
ELSE
    SET xmlStructureParsed = false;
END IF;
SET StringFromDATABASE = nextStringFromdatabase;
END WHILE;

I hope that I have explained this well please help   

[/quote]
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 » FIND XPATH VALUE
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.