Does XML care about the order of elements?

后端 未结 7 1687
盖世英雄少女心
盖世英雄少女心 2020-11-30 10:55

XML confuses me sometimes, but I\'m trying to get this figured out. What the vendor is telling me doesn\'t make sense but again, XML and I don\'t get along :)

I have

7条回答
  •  Happy的楠姐
    2020-11-30 11:27

    Accessing XML by DOM preserves the order of nodes the way they are in your XML document. Look here:

    http://www.w3schools.com/dom/dom_nodes_nodelist.asp

    there you find:

    A node list object represents a list of nodes, in the same order as in the XML.

    If your web service is relying on the order is a different question - it may or may not, that depends on the web service implementation.

提交回复
热议问题