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

Add XML support #67

Open
bannmann opened this issue Aug 31, 2024 · 5 comments
Open

Add XML support #67

bannmann opened this issue Aug 31, 2024 · 5 comments

Comments

@bannmann
Copy link

bannmann commented Aug 31, 2024

It would be great to have support for XML.

My use case is comparing WSDL files that unfortunately have different attribute ordering (which the XML spec says is irrelevant). In this situation, every other diff tool I know fails, even difftastic (see issue Wilfred/difftastic#758).

SemanticDiff, on the other hand, could easily treat the following files as equal (just like the Python example from the docs):

<foo bar="1" quux="true"/>
<foo quux="true" bar="1"/>
@mmueller2012
Copy link
Contributor

mmueller2012 commented Aug 31, 2024

We already have an issue for XML support but it was always a bit unclear whether generic XML support would be useful. The spec does not really define when two documents are identical (with the exception of attribute reordering) and it is mostly up to application specific logic. If there are actual use cases that can benefit from generic rules (ignoring whitespace at the beginning/end of values or attribute reordering) we can take a look into adding support.

@mmueller2012
Copy link
Contributor

Duplicate of #18

@mmueller2012 mmueller2012 marked this as a duplicate of #18 Aug 31, 2024
@williwusel
Copy link

williwusel commented Sep 2, 2024

And please also add ignoring spaces before the closing tag . I need to do XSLT comparison which is basically an XML document and some of my tools add such a space like e.g. here: "<Data />". It is valid XML but it really drives me crazy to see that being flagged as a valid diff.

@mmueller2012
Copy link
Contributor

We just released SemanticDiff 0.10.0 which adds support for XML. It should handle both cases mentioned by @bannmann and @williwusel. Please give it a try and report back if it works for you.

@williwusel
Copy link

Looks like it works now for me

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

No branches or pull requests

3 participants