473,289 Members | 1,866 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,289 software developers and data experts.

command line tool for comparing XML files

Hi all,

Does anybody know a command line tool (linux or windows) that can compare 2
XML files. There's only 1 extra requirement that makes it a bit more
complicated: the order of attributes or elements within an element is of no
importance, and so the tool should still report that 2 XML files are equal
even though the order is different.

Corno
Jul 20 '05 #1
8 6694
xmldiff

at:
http://apps.gotdotnet.com/xmltools/xmldiff/default.aspx
Cheers,

Dimitre Novatchev [XML MVP],
FXSL developer, XML Insider,

http://fxsl.sourceforge.net/ -- the home of FXSL
Resume: http://fxsl.sf.net/DNovatchev/Resume/Res.html
"Corno" <corno@%spam%.dds.nl> wrote in message
news:c0**********@news.tudelft.nl...
Hi all,

Does anybody know a command line tool (linux or windows) that can compare 2 XML files. There's only 1 extra requirement that makes it a bit more
complicated: the order of attributes or elements within an element is of no importance, and so the tool should still report that 2 XML files are equal
even though the order is different.

Corno

Jul 20 '05 #2

"Dimitre Novatchev [MVP XML]" <dn********@yahoo.com> wrote in message
news:c0*************@ID-152440.news.uni-berlin.de...
xmldiff

at:
http://apps.gotdotnet.com/xmltools/xmldiff/default.aspx

Thanks for the suggestion. I tried it out, it had the feature I requested.
But unfortunately, it doesn't seem to give a return value if the files are
different. I need that to automate a build process. Do you know any other
tool that does this?

TIA,

Corno
Jul 20 '05 #3

"Corno" <corno@%spam%.dds.nl> wrote in message
news:c0**********@news.tudelft.nl...

"Dimitre Novatchev [MVP XML]" <dn********@yahoo.com> wrote in message
news:c0*************@ID-152440.news.uni-berlin.de...
xmldiff

at:
http://apps.gotdotnet.com/xmltools/xmldiff/default.aspx

Thanks for the suggestion. I tried it out, it had the feature I requested.
But unfortunately, it doesn't seem to give a return value if the files are
different. I need that to automate a build process. Do you know any other
tool that does this?


You can very easily modify the source code of the XMLDiff console
application (in the Samples folder) so that Class1.Main returns an int and
you will write the necessary "return" statements as you wish.

This sample app now outputs the strings:

"Files are identical."

and

"Files are different."
Cheers,

Dimitre Novatchev [XML MVP],
FXSL developer, XML Insider,

http://fxsl.sourceforge.net/ -- the home of FXSL
Resume: http://fxsl.sf.net/DNovatchev/Resume/Res.html
Jul 20 '05 #4
"Corno" <corno@%spam%.dds.nl> wrote in message news:<c0**********@news.tudelft.nl>...
Hi all,

Does anybody know a command line tool (linux or windows) that can compare 2
XML files. There's only 1 extra requirement that makes it a bit more
complicated: the order of attributes or elements within an element is of no
importance, and so the tool should still report that 2 XML files are equal
even though the order is different.

Corno


Is the generic problem of comparing two unordered labeled trees NP-complete?
I think it had been proven to be NP-complete.
Jul 20 '05 #5
In article <86**************************@posting.google.com >,
Mikhail Grouchinsky <mg**********@comcast.net> wrote:
Does anybody know a command line tool (linux or windows) that can compare 2
XML files. There's only 1 extra requirement that makes it a bit more
complicated: the order of attributes or elements within an element is of no
importance, and so the tool should still report that 2 XML files are equal
even though the order is different.
Is the generic problem of comparing two unordered labeled trees NP-complete?
I think it had been proven to be NP-complete.


Sorting attributes into Unicode order is not NP-complete :-)

-- Richard
--
Spam filter: to mail me from a .com/.net site, put my surname in the headers.

FreeBSD rules!
Jul 20 '05 #6

"Mikhail Grouchinsky" <mg**********@comcast.net> wrote in message
news:86**************************@posting.google.c om...
"Corno" <corno@%spam%.dds.nl> wrote in message news:<c0**********@news.tudelft.nl>...
Hi all,

Does anybody know a command line tool (linux or windows) that can compare 2 XML files. There's only 1 extra requirement that makes it a bit more
complicated: the order of attributes or elements within an element is of no importance, and so the tool should still report that 2 XML files are equal even though the order is different.

Corno


Is the generic problem of comparing two unordered labeled trees

NP-complete? I think it had been proven to be NP-complete.


It would seem to me that it's not; you could first write them in (a)
canonical form and then compare them.

Corno
Jul 20 '05 #7
> > >
Does anybody know a command line tool (linux or windows) that can compare 2 XML files. There's only 1 extra requirement that makes it a bit more
complicated: the order of attributes or elements within an element is of no importance, and so the tool should still report that 2 XML files are equal even though the order is different.

Corno


Is the generic problem of comparing two unordered labeled trees

NP-complete?
I think it had been proven to be NP-complete.


It would seem to me that it's not; you could first write them in (a)
canonical form and then compare them.

Corno


You said order of ELEMENTS doesn't matter too.

EX:

<a>
<c/>
<b>
<c/>
</b>
<b>
<d/>
</b>
</a>

and

<a>
<b>
<d/>
</b>
<c/>
<b>
<c/>
</b>
</a>

are equal (per your first e-mail)

So simple canonicalization is not going to help you as it doesn't
change the order of elements.

In other hand to compare two elements which have children
but have same name and same set of attributes you will run into same
tree comparison problem (you have to compare two subtrees of these
elements).

Anyway I should have been more clear in my first post

It has been proven that computing the edit distance for unordered
labeled trees is NP-complete.

Zhang, R. Statman, D. Shasha, "On the editing distance between
unordered labeled trees",

It seems you are interested only in matching two unordered labeled
trees.
(Which is actually making sure that editing distance is zero).

This task could be easier, but I'm not sure about that.
Jul 20 '05 #8
Joe
Hi, there is a command line tool MDCXML, at http://www.a7soft.com
Joe Andersen.

"Corno" <corno@%spam%.dds.nl> wrote in message news:<c0**********@news.tudelft.nl>...
Hi all,

Does anybody know a command line tool (linux or windows) that can compare 2
XML files. There's only 1 extra requirement that makes it a bit more
complicated: the order of attributes or elements within an element is of no
importance, and so the tool should still report that 2 XML files are equal
even though the order is different.

Corno

Jul 20 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Aquila Deus | last post by:
Hi all! Is there any command-line tool that can add/delete and replace string and files in .resources?
7
by: Dave | last post by:
Does anyone know of a Windows compatible command line tool that capable of parsing Microsoft's VC++ workspace/project (e.g., .dsw, .dsp, .sln, ..vcproj, etc.) files and generating an...
1
by: Sparhawk | last post by:
Hi, I want to integrate a code beautifier for C++ in the development process of my company. There are many beautifiers around which would meet our formatting requirements (SourceFormatX,...
4
by: kendf | last post by:
Appreciated if someone could tell me how to compile the MS Exception Management Application Block downloaded from MS Official site?
5
by: Emmanuel | last post by:
Hi, I am using VS 2003 to build my (csharp) solution. 1. Is there a way to reveal the command line options that VS is using during compilation of a project file, in order to build a batch...
4
by: Helmut Giese | last post by:
Hello out there, this is OT but maybe some of you were in the past faced with the same problem: I have lots of sequences of GIF files to combine into animated GIFs. I can do it 'by hand' with...
6
by: Armel Asselin | last post by:
Hello, I'm searching for a simple command line tool to manipulate XML files. The idea would be commands such as that: xmanip-tool set /document/xpath/@name="value" remove //wrong-nodes add...
1
by: nikhilkumar18 | last post by:
Hi I have made a command line tool which converts a particular log file in .bin format to a text file. But as of now the names of these files are hardcoded i.e it converts log.bin to log.txt. ...
1
by: xtremebass | last post by:
Hi Bytes.. In Linux, How can i get return value of comparing two files using the command cmp in the prompt.. when i was tried, it shows only output of unmatched lines(differ line )/ shows nothing...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.