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 » difference for tag with no value and no tag at all--XMLNSC

Post new topic  Reply to topic
 difference for tag with no value and no tag at all--XMLNSC « View previous topic :: View next topic » 
Author Message
mqsid
PostPosted: Wed May 16, 2007 7:38 am    Post subject: difference for tag with no value and no tag at all--XMLNSC Reply with quote

Newbie

Joined: 26 Jan 2007
Posts: 5

I am having trouble differentiating empty value for the tag and having no tag at all in the input XML.
I tried using,
IF InputRoot.XMLNSC.X:Message.Y:Payload.Y:abc IS NULL THEN
SET xyz = 'xyz';
ELSEIF InputRoot.XMLNSC.X:Message.Y:Payload.Y:abc = '' THEN
SET xyz = 'abc';
END IF;
But the first condition is becoming true for both no tag and tag with empty value.
How can I differentiate these two scenarios?
Any thoughts would be appreciated.
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed May 16, 2007 8:01 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

I think if you use XMLNS rather than XMLNSC it will leave the whitespace in for you.

I'd be interested to know if I'm right.....
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
mqsid
PostPosted: Wed May 16, 2007 9:01 am    Post subject: Reply with quote

Newbie

Joined: 26 Jan 2007
Posts: 5

It works fine with XMLNS. The condition specified in my previous post does the job.
But why is it not working with XMLNSC?
Is this some kind of bug or do you think there is an alter way of doin so with XMLNSC?
Back to top
View user's profile Send private message
jbanoop
PostPosted: Wed May 16, 2007 10:43 am    Post subject: Reply with quote

Chevalier

Joined: 17 Sep 2005
Posts: 401
Location: SC

try using CARDINALITY(). If cardinality is 0 that means tag does not exist in the message.
Back to top
View user's profile Send private message Yahoo Messenger
Vitor
PostPosted: Wed May 16, 2007 11:52 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

mqsid wrote:
It works fine with XMLNS. The condition specified in my previous post does the job.
But why is it not working with XMLNSC?


The compact parser (which why it's a C) removes whitespace. So when you test for "" it's not there. Bug, feature - who can say?
_________________
Honesty is the best policy.
Insanity is the best defence.


Last edited by Vitor on Wed May 16, 2007 11:57 am; edited 1 time in total
Back to top
View user's profile Send private message
kimbert
PostPosted: Wed May 16, 2007 11:54 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

It's a defect. And it will be fixed - IBM is well aware that this distinction is an important one for many users. For now, I suggest that you get it working using CARDINALITY but put a TODO comment next to the code stating that it's a temporary workaround.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Wed May 16, 2007 11:55 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

I'd use FIELDNAME instead of Cardinality.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
mqsid
PostPosted: Wed May 16, 2007 1:07 pm    Post subject: Reply with quote

Newbie

Joined: 26 Jan 2007
Posts: 5

Thank you for all ur assitance. I am going with CARDINALITY as of now.
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 » difference for tag with no value and no tag at all--XMLNSC
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.