开发者

Does xmls nodes sequence matter?

are

<parent>
    <first_child>1111111</first_child>
    <second_child>2222222</second_child>
</parent>  

and

<parent>
    <second_child>2222222</second_child>
    <开发者_运维知识库;first_child>1111111</first_child>
</parent>

should be considered as xmls with the same structure or not?


It entirely depends on what's going to interpret the XML.

Imagine it's actually HTML, and these are paragraph tags... obviously the order matters. In other cases, it may not.


It basically depends on how you define your schema, e.g. with XSD you can use all if order does not matter or sequence if it does. See the w3schools page for details.


It depends on the schema that is used to validate it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜