Posted: Fri Jun 04, 2010 1:17 am Post subject: [Solved] Root reference in XMLNSC domain
Acolyte
Joined: 16 Apr 2010 Posts: 52
I need to route to different label based on the XML message.
Let's say the first XML message is
<Msg1>
<Field1>abc</Field1>
</Msg1>
and the second XML message is
<Msg2>
<Field1>abc</Field1>
</Msg2>
Is there a way to reference that XML root tag in ESQL so that I can route to the correct label?
IF Inputroot.XMLNSC.???? = 'Msg1' THEN
SET OutputLocalEnvironment.Destination.RouterList.DestinationData.labelname = 'Msg1';
ELSE
SET OutputLocalEnvironment.Destination.RouterList.DestinationData.labelname = 'Msg2';
END IF;
Any suggestion/help is much appreciated
Last edited by tatyeong on Fri Jun 04, 2010 2:17 am; edited 1 time in total
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
Take a look at FieldName in the documentation. This may help _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
IF FIELDNAME(InputRoot.XMLNSC.*[>]) = 'Msg1' THEN
SET OutputLocalEnvironment.Destination.RouterList.DestinationData.labelname = 'Msg1';
ELSE
SET OutputLocalEnvironment.Destination.RouterList.DestinationData.labelname = 'Msg2';
END IF;
Last edited by anek77 on Fri Jun 04, 2010 3:40 am; edited 1 time in total
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