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 NULL elements with the attribute xsi:nil="true

Post new topic  Reply to topic
 Removing NULL elements with the attribute xsi:nil="true « View previous topic :: View next topic » 
Author Message
wmbv7newbie
PostPosted: Mon Apr 27, 2015 4:13 am    Post subject: Removing NULL elements with the attribute xsi:nil="true Reply with quote

Centurion

Joined: 13 May 2014
Posts: 121

Hi,

I have a problem with the incoming fields where the element is NULL and has a nil attribute set to true. For e.g. -
Code:
<FieldA xsi:nil="true" />


The problem is that it is a big incoming xml with almost 100 fields and wherever there is no value, I am getting an empty tag like the above.
In my code, I am transforming the incoming message to my canonical message model. But I dont want to set any fields in my canonical where there is no value in the incoming message but only the nil attribute.

I read here -
Quote:
http://www-01.ibm.com/support/knowledgecenter/SSKM8N_8.0.0/com.ibm.etools.mft.doc/ad67010_.htm?lang=en


that the parser will give a no value but a child attribute.

Is there any way I could eliminate such fields in my esql without checking every single field?
Any utility or a Java function which could check such null fields and remove them from the output?
Even a hint to write such would help.

Thanks!
Back to top
View user's profile Send private message
shashivarungupta
PostPosted: Mon Apr 27, 2015 1:43 pm    Post subject: Reply with quote

Grand Master

Joined: 24 Feb 2009
Posts: 1343
Location: Floating in space on a round rock.

You might want to look at following link , which talks about how you deal with null and empty elements.

You might want to check (at info centre) about XML.tag or XML.attr for such elements with child attributes.

Also, in case you are using graphical mapper then you can easily detect (in for each tranformation loop) the elements with nil='true' and use 'create' transform to deal with such elements in the message. (there are few other topics related to the same concern/issue, if you wanted to search.)


_________________
*Life will beat you down, you need to decide to fight back or leave it.
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 » Removing NULL elements with the attribute xsi:nil="true
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.