|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
RESOLVED Supress output of element with NULL value XMLNSC |
« View previous topic :: View next topic » |
Author |
Message
|
iam_wmbuser |
Posted: Thu Jul 24, 2008 4:28 am Post subject: RESOLVED Supress output of element with NULL value XMLNSC |
|
|
 Newbie
Joined: 24 Jul 2008 Posts: 7
|
I have a message flow with a mapping node that transforms input XML to output XML, using a message set and the XMLNSC parser for input and output.
Some of the input elements have a value of NULL in the logical model and I would like to suppress these elements from being output when they are NULL.
There are a large number of elements that this can apply to so I would prefer this to be achievable by message set configuration rather than conditional mapping logic.
I have looked at the "XML representation of null values" options for the message set but they seem to be more for parsing the incoming message rather than controlling how the output message is rendered.
Any suggestions on how to supress the output of empty elements would be good.
Last edited by iam_wmbuser on Fri Jul 25, 2008 4:21 am; edited 2 times in total |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Jul 24, 2008 9:35 am Post subject: Re: Supress output of element with NULL value XMLNSC parser |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
iam_wmbuser wrote: |
I have looked at the "XML representation of null values" options for the message set but they seem to be more for parsing the incoming message rather than controlling how the output message is rendered.
|
I am sure somebody will be able to give you the information for V6.1
In V6.0 and previous the MRM parser will also use those message set settings for output to the bitstream.
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
kimbert |
Posted: Thu Jul 24, 2008 11:13 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Hi,
Good question. The situation is like this:
* Message tree ( v5 onwards )
Any element in the tree can have a value which is explicitly NULL.
* MRM parser ( v5 onwards )
All physical formatsin a message set allow you to specify what a 'NULL' looks like in the bitstream. When parsing, the MRM parser automatically translates physical NULL ( in the input bitstream ) to logical NULL ( in the message tree). When writing, the MRM parser automatically translates logical NULL ( in the message tree ) to physical NULL ( in the output bitstream )
* XMLNSC parser ( v6 )
Does not use a message set at all
* XMLNSC parser ( v6.1 )
Uses the schema definitions in a message set. Does not use any of the information in messageSet.mset. Does not use the information in the XML physical format.
Finally, and this is the bad news for you, even the MRM parser does not allow an element to be omitted because its value is NULL. So XMLNSC cannot do what you require ( because it never looks at the physical format ) and MRM cannot do what you require because it always treats NULL as the value of an element.
However, you are not the first to ask for this. If you care deeply you could even raise a formal requirement.
The workaround is to write ESQL ( or configure your mapping node ) to delete the elements from the message tree. |
|
Back to top |
|
 |
chrisc |
Posted: Thu Jul 24, 2008 9:48 pm Post subject: |
|
|
Voyager
Joined: 19 Mar 2006 Posts: 77
|
kimbert wrote: |
The workaround is to write ESQL ( or configure your mapping node ) to delete the elements from the message tree. |
I vaguely recall looking at this a while ago, and the ESQL gets more and more complex if you start looking at also removing those elements where all the children are null as well. In other words, if you traverse the tree and prune the null values, if you don't also check the count of child elements then you can still end up with things like:
Code: |
<root>
<abc>
<def />
</abc>
</root> |
because root.abc.def.myvalue = null.
Fun and games!  |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|