Why is node order important in XML?

后端 未结 5 589
庸人自扰
庸人自扰 2021-01-05 09:48

I\'ve been dealing with an API recently that requires nodes of the XML document to be in a particular order. I was wondering why they feel the need to enforce this when I ca

5条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-05 10:16

    It's faster and simpler for code to depend on the order of elements.

    It can also prevent certain issues of ambiguity when the order is permitted to be arbitrary.

    Besides, XML isn't meant as much for human readers, as it is meant for computer programs to consume. Computers don't mind doing things in order.

提交回复
热议问题