|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Question on XML input to an MQSI messageflow |
« View previous topic :: View next topic » |
Author |
Message
|
kwelch |
Posted: Thu Oct 11, 2001 1:26 pm Post subject: |
|
|
 Master
Joined: 16 May 2001 Posts: 255
|
Hi all,
I am reading XML data into my MQSI flow and ran across a situation I do not know how to handle. In the data I am receiving a tag that looks like the following . I have been told that this is called an XML shortcut and is used when a required tag has no data. My MQSI process bombed telling me it was getting an unexpected Null. So, I added a check for:
IF name IS NOT NULL THEN
set the OutputRoot.name = InputBody.name;
ELSE
set OutputRoot.name = ' ';(since this is going to a legacy cobol system it needs to have something there.)
END IF;
This produced the same result, unexpected NULL. Does anyone know what code I need to put in place to handle this situation?
Thanks.
Karen
The Hartford Ins. Co.
|
|
Back to top |
|
 |
kwelch |
Posted: Thu Oct 11, 2001 1:30 pm Post subject: |
|
|
 Master
Joined: 16 May 2001 Posts: 255
|
oops! I did not disable the HTML. The tag name from my previous message should display as follows: <name/>
Karen |
|
Back to top |
|
 |
Tibor |
Posted: Thu Oct 11, 2001 1:42 pm Post subject: |
|
|
 Grand Master
Joined: 20 May 2001 Posts: 1033 Location: Hungary
|
Quote: |
On 2001-10-11 14:26, kwelch wrote:
IF name IS NOT NULL THEN
set the OutputRoot.name = InputBody.name;
ELSE
set OutputRoot.name = ' ';(since this is going to a legacy cobol system it needs to have something there.)
END IF;
This produced the same result, unexpected NULL.
|
Karen,
Inputbody is InputRoot.*[LAST] ordinarly InputRoot.[parser].
OutputRoot.name is wrong because where is the parser?
Look a similar code snippet from ESQL reference book:
If InputBody.Wrong.Field IS NOT NULL THEN
SET OutputRoot.XML.Wrong.Field =InputBody.Wrong.Field;
ELSE
SET OutputRoot.XML.Wrong.Field ='';
END IF;
Simpler:
SET OutputRoot.XML.Wrong.Field = coalesce(InputBody.Wrong.Field,'');
Tibor |
|
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
|
|
|
|