regxmllib icon indicating copy to clipboard operation
regxmllib copied to clipboard

Ordering of elements in XML output

Open mglanville opened this issue 10 years ago • 0 comments
trafficstars

The ordering of elements in XML 1.0 (as used by ST 2001-1:2013) is not guaranteed, but many XML tools and specifications utilise document order:

  • the children property of the document information item of the XML-infoset is an ordered list.
  • XPath

SMPTE ST 2001-1:2013 states:

no requirement exists to sort properties into an externally predetermined order

Hence, the XML output from regxmllib legitimately includes elements in any order it sees fit. This order appears to be a function of the input file.

I find this behaviour unhelpful when comparing MXF files using (canonical versions of) their Reg-XML representations. It could also be misleading to a user who might try (in spite of the specification details above) to infer meaning from differing element order.

Would it be possible to have regxmllib output elements in lexicographical order? At the very least, having the members of groups in lexicographical order would be helpful.

mglanville avatar Jul 27 '15 15:07 mglanville