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 » Eliminate empty elements on output XML

Post new topic  Reply to topic
 Eliminate empty elements on output XML « View previous topic :: View next topic » 
Author Message
scravr
PostPosted: Wed Nov 21, 2007 10:31 am    Post subject: Eliminate empty elements on output XML Reply with quote

Partisan

Joined: 03 Apr 2003
Posts: 391
Location: NY NY USA 10021

HI ALL,

On a compute node I generate XML output from imput-XML + DB calls.
How do I eliminate empty output elements?
..
...
..
and happy ThanksGiving to all,
Moshe
Back to top
View user's profile Send private message Send e-mail MSN Messenger
kimbert
PostPosted: Wed Nov 21, 2007 2:21 pm    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

You are using a Compute node, so this is completely under your control. Don't put things in OutputRoot unless you want the corresponding tags in your output message.
Back to top
View user's profile Send private message
AkankshA
PostPosted: Wed Nov 21, 2007 7:48 pm    Post subject: Re: Eliminate empty elements on output XML Reply with quote

Grand Master

Joined: 12 Jan 2006
Posts: 1494
Location: Singapore

scravr wrote:

How do I eliminate empty output elements?


compare the value of elements with ''(empty element) and if the condition is satisfied initialize them to NULL.



_________________
Cheers
Back to top
View user's profile Send private message Visit poster's website
elvis_gn
PostPosted: Wed Nov 21, 2007 10:41 pm    Post subject: Re: Eliminate empty elements on output XML Reply with quote

Padawan

Joined: 08 Oct 2004
Posts: 1905
Location: Dubai

Hi scravr,
AkankshA wrote:
scravr wrote:

How do I eliminate empty output elements?


compare the value of elements with ''(empty element) and if the condition is satisfied initialize them to NULL.
In more elaborate terms...if the DB is returning empty i.e '' use COALESCE, but if not returning fields(which i thought would be a more obvious database architecture) i.e nulls, then use NULLIF.

Regards.
Back to top
View user's profile Send private message Send e-mail
scravr
PostPosted: Thu Nov 22, 2007 8:27 am    Post subject: Reply with quote

Partisan

Joined: 03 Apr 2003
Posts: 391
Location: NY NY USA 10021

The problem is: I have lots of these assignments from InputRoot to OutputRoot and more from DB calls:

SET PCS.INCIDENTDATETIME = AIB.INCIDENTDATETIME;
SET PCS.DESCRIPTIONRECURRINGTIME = AIB.DESCRIPTIONRECURRINGTIME;
SET PCS.VARCHAR100_3 = AIB.VARCHAR100_3;
SET PCS.REFERRINGAGENCY = AIB.REFERRINGAGENCY;
SET PCS.LOCATIONTYPE = AIB.LOCATIONTYPE;
SET PCS.AREATYPE = AIB.AREATYPE;
(PCS points to OutputRoot and AIB points to InputRoot)

So if I need to check each for NULL (or empty), the code will go from 300 lines to 1800 lines:
(adding the: IF .... = NULL THEN ... ELSE... END IF)

Since many of input elements maybe empty (in some cases), I am looking to see if there is a simpler way to ask compute node (or some other node following the comute) to eliminate empty elements.




One more related question:
--------------------------------
I created a msg-set + dictionary from XSD file.
The flow gets MQinput XML file according to XSD.
The above compute node needs to create a new XML msg (as a subset of the original input).
Last step is to MQoutput the new generated XML to a Q.

The MQinput node parsh the XML correctly (as MRM with the msg-set format). The compute node maps input to output correctly, and msg is posted nicly on outQ.
Great ha....
But when looking into trace I see lot of error messages on the MQoutput, saying new XML is not formated corectly according to XSD.
Well, the new XML as nothing to do with the XSD...
How to I gener a new XML that has no relation to other XML, XSD...?
What do I need to copy from InputRoot to OutputRoot?

SET OutputRoot = InputRoot;
SET OutputRoot.Properties= InputRoot.Properties;
SET OutputRoot.MRM = NULL;
CREATE LASTCHILD OF OutputRoot DOMAIN 'XMLNSC';
DECLARE PCS REFERENCE TO OutputRoot.XMLNSC;

Anything else ?????
Back to top
View user's profile Send private message Send e-mail MSN Messenger
fjb_saper
PostPosted: Thu Nov 22, 2007 10:33 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

add
SET PSC.myxmlroottag = InputRoot.MRM;

or your mapping for PSC.myxmlroottag....
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Eliminate empty elements on output XML
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.