in reply to How to avoid addition of tags by HTML::TreeBuilder

I mean, from a specification point of view, it's technically not changing the document. Just as <p foo="1" bar="2"></p> and <p bar="2" foo="1"></p> are considered exactly equivalent by the HTML specs, the expected output and actual output are exactly equivalent.

Given that the expected output and actual output are equivalent and will be treated identically by any browsers and other software that conforms to the HTML specs, I feel like we're missing some bit of information… what about the current output is unacceptable to you?