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 » order of XML elements

Post new topic  Reply to topic
 order of XML elements « View previous topic :: View next topic » 
Author Message
WBI_user
PostPosted: Tue Mar 15, 2005 10:02 am    Post subject: order of XML elements Reply with quote

Partisan

Joined: 07 Aug 2001
Posts: 386

A program expects the input as follow:
<ROOT>
<AA>
<11>... </11>
:
<99> .. </99>
</AA>
<BB>
<XX>... </XX>
:
<ZZ> .. </ZZ>
</BB>
<CC>
<MM>... </MM>
:
<RR> .. </RR>
</CC>
</ROOT>

I am using WBI MB to produce the XML message to input to the program and the output looks like:
<ROOT>
<AA>
<11>... </11>
:
<99> .. </99>
</AA>
<CC>
<MM>... </MM>
:
<RR> .. </RR>
</CC>
<BB>
<XX>... </XX>
:
<ZZ> .. </ZZ>
</BB>
</ROOT>

The sequence of the elements is AA CC BB instead of AA BB CC expected by the program.

I am a beginner to XML. My questions are
1. Within XML specification, does the sequence of the XML element within the same level matters. If it does not not, then the program should accept the output from the broker with no complain.
2. If it does matters, how do I ensure that the broker will output the XML in the right order. Should the order be in exactly the sequence of the ESQL coded. Is there any way that can affect the order that the MB output the XML elements ?
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Mar 15, 2005 10:10 am    Post subject: Re: order of XML elements Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

WBI_user wrote:
1. Within XML specification, does the sequence of the XML element within the same level matters. If it does not not, then the program should accept the output from the broker with no complain.
It depends.
WBI_user wrote:
Should the order be in exactly the sequence of the ESQL coded. Is there any way that can affect the order that the MB output the XML elements ?

What does the ESQL documentation say?
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
fuwafuwausagi
PostPosted: Tue Mar 15, 2005 11:19 am    Post subject: Reply with quote

Newbie

Joined: 17 May 2001
Posts: 2

It depends is the answer.

However in general a program should not car about the tag order within a tag.

So if I had:

<Outer>
<Data>
<Animals>
<Cat>
<Claws>sharp</Claws>
<Fur>fluffy</Fur>
</Cat>
<Dog>
<Claws>blunt</Claws>
<Fur>smelly</Fur>
</Dog>
</Animals>
</Data>
</Outer>

It should make no difference to an application program trying to access the value of "smelly" in Outer.Data.Animals.Dog.Fur if the date is:

<Outer>
<Data>
<Animals>
<Cat>
<Claws>sharp</Claws>
<Fur>fluffy</Fur>
</Cat>
<Dog>
<Fur>smelly</Fur>
<Claws>blunt</Claws>
</Dog>
</Animals>
</Data>
</Outer>

OR

<Outer>
<Data>
<Animals>
<Dog>
<Claws>blunt</Claws>
<Fur>smelly</Fur>
</Dog>
<Cat>
<Claws>sharp</Claws>
<Fur>fluffy</Fur>
</Cat>
</Animals>
</Data>
</Outer>

The answer should be the same.

The broker builds the fields in the order you tell it to.

Regards,

FuwaFuwaUsagi
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 » order of XML elements
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.