[Xml-logilab] xmldiff functionality

Olivier CAYROL (Logilab) Olivier.Cayrol@logilab.fr
Tue, 26 Feb 2002 21:31:41 +0100 (CET)


On Tue, 26 Feb 2002, Daniel wrote:

> I tried xmldiff by moving a <tag> from one point to another, such as in
> this scenario:
>=20
> ...
>=20
> As both XML's contain the exact same information, as far as XML is
> concerned, I was hoping xml diff would tell me both are equal.

The two XML documents you sent are different because an XML document is an
ordered tree. In most of the applications, the order of the nodes doesn't
matter as long as they contain the same information. But in some
applications, it is very important, here is an example in XSL-FO:
  <fo:page-sequence>
    <fo:block font-size=3D"15pt">My title</fo:block>
    <fo:block>My first paragraph</fo:block>
  </fo:page-sequence>
  The first fo:block displays the title and the second one the first
  paragraph. You do want the title to be displayed before the
  paragraph thus you inserted the title before the paragraph.

That's why xmldiff states that your two documents are different and as far
as I remember, it states that the two nodes have been switched.

    O. CAYROL.
_________________________________________________________________________
Olivier CAYROL                                   LOGILAB - Paris (France)
                                                 http://www.logilab.com/
Change your millenium, try NARVAL the Intelligent Personal Assistant.
Changez de mill=E9naire, essayez NARVAL l'Assistant Personnel Intelligent.
_________________________________________________________________________