|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
XML element order and WMB serializers? |
« View previous topic :: View next topic » |
Author |
Message
|
sleepyjamie |
Posted: Wed Sep 16, 2015 12:35 pm Post subject: XML element order and WMB serializers? |
|
|
Centurion
Joined: 29 Apr 2015 Posts: 135
|
I am wondering how the Message Broker serializers handles ordering of the XML elements during serialization.
For example:
DECLARE 'ns' NAMESPACE 'http://www.somenamespace.com/MyData'
SET OutputRoot.XMLNSC.ns:MyData.Element2 = 'Value2';
SET OutputRoot.XMLNSC.ns:MyData.Element1 = 'Value1';
If the schema requires Element1 to be before the Element2, I am wondering if Message Broker can order the elements when serializing, regardless on how the developer sets them in the tree hierarchy. |
|
Back to top |
|
 |
Vitor |
Posted: Wed Sep 16, 2015 2:16 pm Post subject: Re: XML element order and WMB serializers? |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
sleepyjamie wrote: |
I am wondering if Message Broker can order the elements when serializing, regardless on how the developer sets them in the tree hierarchy. |
Not so far as I'm aware, and broker doesn't even care if the serialized XML matches the schema unless the developer has indicated that the XML should be validated. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
timber |
Posted: Wed Sep 16, 2015 2:43 pm Post subject: |
|
|
 Grand Master
Joined: 25 Aug 2015 Posts: 1292
|
This is a standard FAQ for WMB / IIB.
WMB and IIB will serialize the XML in the order in which the elements appear in the tree. So the only way to get your output in the correct order is to build the tree in the correct order.
That can be a real pain if you are using ESQL or plain Java. It's guaranteed for you if you use
a) the Mapping node or
b) a JavaCompute node with JAXB classes generated from the schemas.
For those who are determined to use Java in their message flows, b) is a pretty good option anyway. |
|
Back to top |
|
 |
sleepyjamie |
Posted: Thu Sep 17, 2015 6:14 am Post subject: |
|
|
Centurion
Joined: 29 Apr 2015 Posts: 135
|
thank you  |
|
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
|
|
|
|