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] Comparing xml fragments

John, hello.

On 3 Aug 2018, at 16:12, John Dziurlaj wrote:

These fragments have repeating elements, and I worry that parsers / writers
may rewrite the fragments such that the order of their sub elements may
change, making comparison difficult. Is this a valid concern, and what can
I do about it?
An XML parser is permitted to report _attributes_ in any order, but a parser is emphatically not permitted to reorder elements.

A particular XML-parser library might, for its own specialised (speed?) reasons, choose to ignore this, and an application layer above the parser may elect to regard differently-ordered child elements as equivalent, but the ordering of elements (but not attributes) is in general a significant property of an XML document.

If you want to normalise XML fragments, that's a separate issue.

Best wishes,

Norman


--
Norman Gray : https://nxg.me.uk


[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