|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Using A Filter Node |
« View previous topic :: View next topic » |
Author |
Message
|
gowdy |
Posted: Wed Sep 12, 2001 7:45 am Post subject: |
|
|
Apprentice
Joined: 17 Jul 2001 Posts: 29 Location: Bournemouth, UK
|
Hi
I want to use a filter node to check the contents of an XML tag. If I am checking for the contents do I use single or double quotes in the ESQL
eg InputBody.MyMessage.TagA = 'Yes'
or
InputBody.MyMessage.TagA = "Yes"
Secondly, if I want to check if it is empty do I need to put a space(or spaces) between the (single or double) quotes?
eg InputBody.MyMessage.TagA = ""
or
InputBody.MyMessage.TagA = " "
Apologies for the simple standard of the question, but very new to using MQSI.
Kind regards
Mark
|
|
Back to top |
|
 |
MVO |
Posted: Thu Sep 13, 2001 10:29 am Post subject: |
|
|
 Centurion
Joined: 09 Sep 2001 Posts: 131
|
1) Use single quote
2) To check for empty string use either
a) LENGTH function e.g. LENGTH(Root.XML.Field1)=0
b) ROOT.XML.Field1 IS NULL |
|
Back to top |
|
 |
Tabraham |
Posted: Fri Sep 14, 2001 9:34 am Post subject: |
|
|
Newbie
Joined: 16 May 2001 Posts: 4 Location: Dallas, Texas
|
Also, you use Body.xxxx not InputBody.xxxx. |
|
Back to top |
|
 |
Outdesign |
Posted: Mon Sep 17, 2001 2:52 am Post subject: |
|
|
Apprentice
Joined: 16 Sep 2001 Posts: 38 Location: Hampshire, UK
|
b) ROOT.XML.Field1 IS NULL
The following is incorrect.
IS NULL will check to see if an element exists, not it's contents.
The case is also incorrect, it should reference "Root" not "ROOT".
To check if an element is empty, you can use option 2a) but this uses
a function (LENGTH) or you can use simply use the following syntax :
/* note, two single quotes next to each other */
Body.MyMessage.TagA = ''
|
|
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
|
|
|
|