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

Fix comparison to return -1, 0, 1 and Improve xml element content comparison #14

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

bsrouji
Copy link

@bsrouji bsrouji commented Jun 2, 2021

Fix comparison to respect -1, 0 or 1 return value, we can't assume returning 1 if col1 is lower than col2
Also improved comparison so when xml element have the same name and the same attributes, we shall then compare based on the xml content
for example:

<tests>
<test>2</test>
<test>1</test>
</tests>

should sort to:
<tests>
<test>1</test>
<test>2</test>
</tests>

…turning 1 if col1 is lower than col2

Also improved comparison so when xml element have the same name and the same attributes, we shall then compare based on the xml content
for example:
<tests>
<test>2</test>
<test>1</test>
</tests>

should sort to:
<tests>
<test>1</test>
<test>2</test>
</tests>
@bsrouji
Copy link
Author

bsrouji commented Jun 3, 2021

I had to redo the fix and enable unit test that use your test_files
I also added a new h test case file
be aware I changed some of your _sorted files as with the new algorythm is sorting the innterxml when xmlelement and attributes are matching, also as we respect the return code (-1, 0, 1)

@kosi2801
Copy link

This improvement would be very appreciated. Is there any chance that this will be merged in the foreseeable future?
Or are there any parts missing or other reasons that require an improvement of this PR?

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

Successfully merging this pull request may close these issues.

None yet

2 participants