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 » String Evaluation

Post new topic  Reply to topic
 String Evaluation « View previous topic :: View next topic » 
Author Message
DanielSonFocus
PostPosted: Mon Jun 13, 2005 10:38 am    Post subject: String Evaluation Reply with quote

Apprentice

Joined: 05 Jun 2005
Posts: 35
Location: Louisville, Kentucky

Input XML:
------------
<xml>
<a>apple</a>
<b></b>
<c>cat</c>
</xml>

My expected Reply XML:
----------------------------
<xml>
<a>apple</a>
<c>cat</c>
</xml>

Given the input XML above i've written the following ESQL.. the string comparison does not get rid of the blank tag.. any ideas?

DECLARE a REFERENCE TO InutRoot.XML."xml".a
DECLARE b REFERENCE TO InutRoot.XML."xml".b
DECLARE c REFERENCE TO InutRoot.XML."xml".c

DECLARE aVal CHAR TRIM(BOTH ' ' FROM a);
DECLARE bVal CHAR TRIM(BOTH ' ' FROM b);
DECLARE cVal CHAR TRIM(BOTH ' ' FROM c);

IF aVal IS NOT NULL or aVal <> '' THEN
SET OutputRoot.XML."xml".aVal = aVal;
END IF;

IF bVal IS NOT NULL or bVal <> '' THEN
SET OutputRoot.XML."xml".bVal = bVal;
END IF;

IF c IS NOT NULL or cVal <> '' THEN
SET OutputRoot.XML."xml".cVal = cVal;
END IF;

This code keeps returning this:
<xml>
<a>apple</a>
<b></b>
<c>cat</c>
</xml>

Any help would be greatly appreciated...
Back to top
View user's profile Send private message
mayur2378
PostPosted: Mon Jun 13, 2005 11:23 am    Post subject: Reply with quote

Apprentice

Joined: 26 May 2004
Posts: 47

It might be silly and you probably must have done it but Just wanted to make sure u have the Copy MessageHeader procedure uncommented and not the Copy Entire Message

Mayur
Back to top
View user's profile Send private message Yahoo Messenger
DanielSonFocus
PostPosted: Mon Jun 13, 2005 11:40 am    Post subject: Reply with quote

Apprentice

Joined: 05 Jun 2005
Posts: 35
Location: Louisville, Kentucky

I don't need to set use CopyEntireMessage because i have "ALL" not just "Message" being passed through the node.
Back to top
View user's profile Send private message
EddieA
PostPosted: Mon Jun 13, 2005 3:02 pm    Post subject: Reply with quote

Jedi

Joined: 28 Jun 2001
Posts: 2453
Location: Los Angeles

The question was not about the Node Properties. It was about the ESQL inside the Compute.

Cheers,
_________________
Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Jun 14, 2005 3:15 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

EddieA wrote:
The question was not about the Node Properties. It was about the ESQL inside the Compute.

And the two are mostly unrelated.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
mgk
PostPosted: Tue Jun 14, 2005 4:57 am    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1642

Hi,

You logic is wrong in the IF test. Use AND not OR, as in:

Code:
IF bVal IS NOT NULL AND bVal <> '' THEN


rather than:

Code:
IF bVal IS NOT NULL OR bVal <> '' THEN



Cheers,
_________________
MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
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 » String Evaluation
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.