alovak / test_xml

Small library to test your xml with Test::Unit or RSpec
Other
30 stars 8 forks source link

Does order matter? #6

Open apotonick opened 13 years ago

apotonick commented 13 years ago

In my current implementation

<div>
  <a />
  <b />
</div>

is not equal to

<div>
  <b />
  <a />
</div>

This feels right. What's your opinion?

alovak commented 13 years ago

it should not matter :) structure and content should matter. if we will represent elements in css/xpath selectors than we will not get any difference between this xml's :)

apotonick commented 13 years ago

http://www.ibm.com/developerworks/xml/library/x-eleord.html

apotonick commented 13 years ago

I guess we have to support both. Your argumentation is right, often you don't care about order. But what if you want to assert

   ul
    li id="first"
    li id="second"

where the order really affects the presentation?

We need both. Damnit, more work ;-)