XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
RE: [xml-dev] Keep sequencing order of XML list of elements?

Yes, you can assume that the order of elements will be preserved. The writers of the XML specification neglected to say this explicitly, but that's because they thought it was obvious. A parser that didn't preserve order might be technically conformant, but no-one would ever use it; many, many XML applications depend on order being preserved, notably those that use XML to represent documents.
 
Michael Kay
Saxonica
 
 


From: Porzio, Christian [mailto:christian.porzio@hp.com]
Sent: 08 March 2010 16:04
To: xml-dev@lists.xml.org
Subject: [xml-dev] Keep sequencing order of XML list of elements?

Hi,
 
I am involved in an international initiative to standardize the communication protocol of airport devices.
We heavily use XML in our standard and we are facing a question that no one in our group, including myself can come to a resolution without adding more complexity.
 
The problem is:
Can we assume a sequence of identical XML nodes will have the same order in the memory of the receiver once they have been parsed?
 
Or do we have to add a sequenceID element to ensure the receiver orders these nodes accordingly.
 
In other words, should we send:
<?xml version="1.0" encoding="utf-8"?>
<OrderedMessages>
<Message ID="1">Text1</Message>
<Message ID="2">Text2</Message>
<Message ID="3">Text3</Message>
</OrderedMessages>
 
or more simply
 
<?xml version="1.0" encoding="utf-8"?>
<OrderedMessages>
<Message>Text1</Message>
<Message>Text2</Message>
<Message>Text3</Message>
</OrderedMessages>
 
If we want to make sure that Text1 is processed 1st then Text2, so on and so forth.
 
It is my understanding if we enforce DOM parsing, then the ID is useless as the text elements will naturally keep the same sequencing.
 
Any feedbacks or references would be greatly appreciated. I haven't found any specifics so far.
 
Thank you many in advance for your assistance.
 
Regards
 
Christian Porzio
Transportation Application Unit
HP Enterprise Services
Mobile +1 404 610 6128
Email: christian.porzio@hp.com
 
 
 


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS