aspose file tools*
The moose likes XML and Related Technologies and the fly likes XML natural order for multiple occurence elements Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "XML natural order for multiple occurence elements" Watch "XML natural order for multiple occurence elements" New topic
Author

XML natural order for multiple occurence elements

Greg Parker
Greenhorn

Joined: Aug 13, 2010
Posts: 10
Does the specification say anything about the natural order in xml? Means, when an element which has multiple occurence gets parsed is it guaranteed across parsers that we will get the elements in the same order in the parsed tree? Or do we need to define an attribute to indicate order?
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

http://www.ibm.com/developerworks/xml/library/x-eleord.html
Greg Parker
Greenhorn

Joined: Aug 13, 2010
Posts: 10
David Newton wrote:http://www.ibm.com/developerworks/xml/library/x-eleord.html


Does this mean just by introducing a schema, and having a maxOccurs="unbounded" will make the parser bound to report the elements in the document order?
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

I don't know why it would, or how that's related--is there something you've read that makes you think it's relevant?
Greg Parker
Greenhorn

Joined: Aug 13, 2010
Posts: 10
David Newton wrote:I don't know why it would, or how that's related--is there something you've read that makes you think it's relevant?

From reading the article. This is what I got.
Normal xml specification doesn't say anything about order or any other processing instructions.
Processing instructions follow a separate specification which usually refers to XML info set specification.
So might get the order?

Also please help me with why we have XML infoset specification?
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12821
    
    5
1. Infoset provides a clear set of definitions for talking about parts of an XML document.

2. Infoset provides a way to state whether or not some process handles all of the information in an XML document.

I suspect that the W3C thought Infoset became necessary as the number of tools for manipulation of XML grew and grew.

Bill
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: XML natural order for multiple occurence elements