[
Lists Home |
Date Index |
Thread Index
]
Dear Distinguished Colleagues:
I am working on a little pet project -- writing a tool for comparing
XML files.
I had to use XMLDiff tool (http://www.logilab.org/projects/xmldiff) as
well as the XML comparison tool in XMLSpy on Friday and was
disappointed with not only its performance comparing two relatively
large XML files (over 500K each) but also with the quality of its
output.
I am going to start off with a very simple comparison.
Given two files, file A and file B, I want to know whether all nodes
from A exist in B and confirm that they are in the same positions from
XPath standpoint. I think in 90% of XML comparison cases, especially
the ones involving XML schemas, these are the ones that matter.
So, here is what I have so far:
I've written an XSL transform (genComparator.xslt) that when applied
to the master file generates another XSL transform (comparator.xslt)
that confirms the existance and positions of nodes from the master
file in the copy file. It basically checks whether the files are
equivalent from the XPath standpoint. Even if the "copy" has more
nodes than in the input file, it is irrelevant as long as the XPaths
are still the same (which means that the same programmatic tools can
be used).
There are more details on my blog at
http://www.olegdulin.com/index.php?cat=8
I need some help with it, so any input is greatly appreciated,
especially with regard to this: I don't know how to declare all
namespaces used in the master file in the 2nd order XSL. The problem
is that "xmlns:" attributes are not recognized using XPath and I can't
copy them over. Any thoughts are greatly appreciated.
Kind regards,
Oleg
|