ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Element existence check, followed by empty value test

Post new topic  Reply to topic
 Element existence check, followed by empty value test « View previous topic :: View next topic » 
Author Message
Mut1ey
PostPosted: Wed Mar 16, 2011 9:10 am    Post subject: Element existence check, followed by empty value test Reply with quote

Acolyte

Joined: 07 Oct 2005
Posts: 74
Location: England

A general query. Based on an XSD we have some optional elements in the XML(NSC) tree, surprise surprise.

We want to execute path A if the element either does not exist or has a null/ empty string value, or execute path B otherwise. So path A if element does not exist in incoming tree or does exist but is empty. Path B only if element exists and has a non-zero length value.

In ESQL I would use IF EXISTS syntax to confirm that the element exists and then check the element value for the empty string (""). A colleague is using the IF element IS NOT NULL syntax which seems to do both the check for existence and also for null/ empty string value. This is during a debug session, so the debug may be doing something additional. Either way, what approach do you use in this case?

Using broker toolkit and runtime 6.1.4 on windows XP.
Back to top
View user's profile Send private message
kimbert
PostPosted: Wed Mar 16, 2011 10:34 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Those are three separate conditions, and your code should check for them separately.
- IF EXISTS to see whether the field is in the message tree
- IS NULL / IS NOT NULL to check whether it has an explicit null value
( for XMLNSC this is only possible if xsi:nil=true in the xsd )
- FIELDVALUE(fieldref)="" to check whether the field is the empty string.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Element existence check, followed by empty value test
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.