Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A flag to ignore order #56

Open
regebro opened this issue Oct 22, 2019 · 4 comments
Open

A flag to ignore order #56

regebro opened this issue Oct 22, 2019 · 4 comments
Labels
enhancement New feature or request

Comments

@regebro
Copy link
Contributor

regebro commented Oct 22, 2019

Some XML formats don't care about the order of the nodes in a subnode. A flag to skip reordering in one node might be useful for some formats. Comment here if you need this (because if no one actually need it, it won't happen).

@regebro regebro added the enhancement New feature or request label Oct 22, 2019
@alexmirrington
Copy link

I ran across this problem in a project of mine, where I was comparing musical scores with xmldiff. I didn't care about the order of layers within a bar, for example, but did care about the order of bars within a piece and the order of notes and rests within a bar.

I ended up using xmldiff anyway, however the output of the comparison would be much cleaner with the ability to ignore order for certain node types.

@rishabhgpt
Copy link

rishabhgpt commented Jun 2, 2021

Is this an active request at the moment ? Commenting here because we need it and encountered many scenarios where ordering is not important and xmldiff unnecessarily move around the child nodes.

@regebro
Copy link
Contributor Author

regebro commented Jun 2, 2021

If you mean if somebody is actively working on it, to my knowledge no. I'm also not entirely convinced it should be a feature. xmldiff shows you the difference. If there are differences you don't care about, that's to some extent up to you.

Another option might be having a command to "sort" the XML files before the diffing. But that could potentially have other issues.

It's also notable that you ask about attributes, and Alex above asked for nodes, but only certain type of nodes. If we support this in xmldiff it would likely just to ignore ordering full stop.

@regebro
Copy link
Contributor Author

regebro commented Jan 4, 2024

It's also important to know that this would make the output unusable to patch things, so it's only relevant for formatters intended to be used by humans, but NOT when using formats intended for humans, as then the order WOULD be important. So it's a rather narrow usecase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants