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 » removing empty XML tags

Post new topic  Reply to topic
 removing empty XML tags « View previous topic :: View next topic » 
Author Message
chris boehnke
PostPosted: Fri Sep 25, 2015 9:35 am    Post subject: removing empty XML tags Reply with quote

Partisan

Joined: 25 Jul 2006
Posts: 369

All,

We are using Message broker V8.0.0.2.


I am using ESQL to map the data from backend to client response. The data coming from backend is a collection of benefits.

So in order to map correctly with the client response schema,
a. I am first creating the XML whith empty tags, which matches the client schema.
b. Then I am mapiong the values to the client rsp created.

I am seeing empty tags for which there is no data.

How can I remove the empty tags after mapping the backend data?
Back to top
View user's profile Send private message
smdavies99
PostPosted: Fri Sep 25, 2015 9:46 am    Post subject: Re: removing empty XML tags Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

chris boehnke wrote:

a. I am first creating the XML whith empty tags, which matches the client schema.

sorry to be a bit pedantic on a Friday but you are not creating the XML. You are creating a message tree. This is only converted to XML when the tree hits whatver output node you have wired into your flow.

As for what your want then something like this might do the job
Quote:

set OutputRoot.XMLNSC.Data.Tree1.Tree2.Tree3 = NULL;

To delete the .Tree3 element.
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
joebuckeye
PostPosted: Fri Sep 25, 2015 11:23 am    Post subject: Re: removing empty XML tags Reply with quote

Partisan

Joined: 24 Aug 2007
Posts: 365
Location: Columbus, OH

chris boehnke wrote:
So in order to map correctly with the client response schema,
a. I am first creating the XML whith empty tags, which matches the client schema.
b. Then I am mapiong the values to the client rsp created.


Why are these separate steps?

Why are you not mapping the values as you are creating the message tree?

Also, you may need to keep empty tags if the schema calls for it (rare but possible). Remember your response needs to match the schema when you are done with your mapping, not before then.

This way if the mapped data does not exist it should map to NULL and remove (or not create) that element in the message tree.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Thu Oct 01, 2015 6:14 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

The only reason to create an empty message tree representing an XML document before you populate the fields is to ensure that the resulting XML document is in the correct order when it's serialized.

It's usually more straight forward to just make sure your ESQL executes in the proper order when you populate fields in the message tree.
_________________
chmod -R ugo-wx /
Back to top
View user's profile Send private message
timber
PostPosted: Thu Oct 01, 2015 7:53 am    Post subject: Reply with quote

Grand Master

Joined: 25 Aug 2015
Posts: 1292

I agree. And in current versions of IIB either a Mapping node, or a JavaCompute node using JAXB, is a better solution.
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 » removing empty XML tags
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.