|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Output XML message using AsisElementContent |
« View previous topic :: View next topic » |
Author |
Message
|
WBI_user |
Posted: Mon Sep 10, 2007 9:06 am Post subject: Output XML message using AsisElementContent |
|
|
Partisan
Joined: 07 Aug 2001 Posts: 386
|
I need to ouput a XML message inside an XML tag. Here is my test
MQInput--Compute--MQOutput
ESQL in compute
DECLARE MYMSGC CHAR;
SET MYMSGC = '<MY_DATA><MY_MSG>THIS IS AN ORDER</MY_MSG></MY_DATA>';
SET OutputRoot.XMLNSC.MYMSG.OriginalMessageData.(XML.AsisElementContent)= LTRIM(MYMSGC);
The result of running the flow shows
<MYMSG><OriginalMessageData></OriginalMessageData></MYMSG>
The user trace shows
2007-09-10 12:56:18.161121 3476 UserTrace BIP2537I: Node 'TEST_ASIS.Compute': Executing statement ''SET OutputRoot.XMLNSC.MYMSG.OriginalMessageData.(XML.AsisElementContent)*:* = LTRIM(MYMSGC);'' at ('.TEST_ASIS_Compute.CopyMessageHeaders', '12.2').
2007-09-10 12:56:18.161136 3476 UserTrace BIP2539I: Node 'TEST_ASIS.Compute': Evaluating expression ''MYMSGC'' at ('.TEST_ASIS_Compute.CopyMessageHeaders', '12.82'). This resolved to ''MYMSGC''. The result was '''<MY_DATA><MY_MSG>THIS IS AN ORDER</MY_MSG></MY_DATA>'''.
2007-09-10 12:56:18.161151 3476 UserTrace BIP2539I: Node 'TEST_ASIS.Compute': Evaluating expression ''LTRIM(MYMSGC)'' at ('.TEST_ASIS_Compute.CopyMessageHeaders', '12.76'). This resolved to ''LTRIM('<MY_DATA><MY_MSG>THIS IS AN ORDER</MY_MSG></MY_DATA>', NULL)''. The result was '''<MY_DATA><MY_MSG>THIS IS AN ORDER</MY_MSG></MY_DATA>'''.
2007-09-10 12:56:18.161182 3476 UserTrace BIP2539I: Node 'TEST_ASIS.Compute': Evaluating expression ''XML.AsisElementContent'' at ('.TEST_ASIS_Compute.CopyMessageHeaders', '12.51'). This resolved to ''XML.AsisElementContent''. The result was ''100663336''.
2007-09-10 12:56:18.161195 3476 UserTrace BIP2566I: Node 'TEST_ASIS.Compute': Assigning value '''<MY_DATA><MY_MSG>THIS IS AN ORDER</MY_MSG></MY_DATA>''' to field / variable ''OutputRoot.XMLNSC.MYMSG.OriginalMessageData.(XML.AsisElementContent)*:*''.
2007-09-10 12:56:18.161216 3476 UserTrace BIP2537I: Node 'TEST_ASIS.Compute': Executing statement ''RETURN TRUE;'' at ('.TEST_ASIS_Compute.Main', '5.3').
Is this a bug or I did something wrong ? |
|
Back to top |
|
 |
EAI Developer |
Posted: Thu Sep 13, 2007 3:56 am Post subject: |
|
|
 Centurion
Joined: 30 Nov 2005 Posts: 101 Location: US
|
Hi,
Try to remove .(XML.AsisElementContent) ,it will work.
Cheers,
EAI Developer. |
|
Back to top |
|
 |
kimbert |
Posted: Thu Sep 13, 2007 5:31 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
You did something wrong. You can't use field type constants beginning with 'XML.' with the XMLNSC parser. The confusion probably arises because XML and XMLNS use the same field type constants. XMLNSC uses a completely different set of constants. They are documented, so a search in the docs should turn them up.
If you want to output some literal text without the parser interfering with it ( and since you seem determined not to use CDATA ) you could experiment with XMLNSC.Bitstream. |
|
Back to top |
|
 |
WBI_user |
Posted: Thu Sep 13, 2007 3:56 pm Post subject: |
|
|
Partisan
Joined: 07 Aug 2001 Posts: 386
|
But this is what shows in the WMB V6 Info center
The following example illustrates the use of AsisElementContent. The statement:
Set OutputRoot.XML.(XML.Element)Message.(XML.Content) = '<rawMarkup>';
generates the following XML in an output message:
<Message><rawMarkup></Message>
However, the statement
Set OutputRoot.XML.(XML.Element)Message.(XML.AsisElementContent) = '<rawMarkup>';
generates the following output message:
<Message><rawMarkup></Message>
That's why I was trying my test case. I cannot see what's the difference between my test case vs what's documented. Can you help me to understand ? |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Sep 13, 2007 4:11 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You can't use XML constants with the XMLNSC parser.
That's what you did wrong.
If you can't see what's different between your code and the sample code, then you don't understand how to build references to ESQL fields. _________________ I am *not* the model of the modern major general. |
|
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
|
|
|
|