[XML-DEV Mailing List Archive Home]
[By Thread]
[By Date]
[Recent Entries]
[Reply To This Message]
RE: Keep sequencing order of XML list of elements?
- From: "Michael Kay" <mike@saxonica.com>
- To: "'Porzio, Christian'" <christian.porzio@hp.com>,<xml-dev@l...>
- Date: Mon, 8 Mar 2010 21:13:21 -0000
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
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]
|
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format
RSS 2.0 |
 |
Atom 0.3 |
 |
|
Stylus Studio has published XML-DEV in RSS and ATOM formats,
enabling users to easily subcribe to the list from their preferred news reader application.
|
Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website.
they were not included by the author in the initial post. To view the content without the Sponsor Links please
click here.
|
|