|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
FIND XPATH VALUE |
« View previous topic :: View next topic » |
Author |
Message
|
matuwe |
Posted: Fri Apr 23, 2010 5:14 am Post subject: FIND XPATH VALUE |
|
|
 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 |
|
 |
raghu1984 |
Posted: Sun May 02, 2010 3:22 am Post subject: |
|
|
 Newbie
Joined: 10 Dec 2009 Posts: 7
|
Hi,
Use it this way,
Code: |
InputRoot.XMLNS.ESB_WRAPPER.INPUTS.{it};
|
|
|
Back to top |
|
 |
mqjeff |
Posted: Sun May 02, 2010 4:51 am Post subject: |
|
|
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 |
|
 |
vikashsharma85 |
Posted: Sun May 02, 2010 9:27 pm Post subject: |
|
|
 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 |
|
 |
matuwe |
Posted: Fri May 07, 2010 6:27 am Post subject: |
|
|
 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 |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|