HELP - Getting a Difference between XML documents?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ed

    #1

    HELP - Getting a Difference between XML documents?

    Hi,

    I have 2 sets of XML documents.

    XML1 is:
    <Root>
    <Node1>111</Node1>
    <Node2>222</Node2>
    <Node3>333</Node3>
    <Node4>
    <Node4A>444A</Node4A>
    <Node4B>444B</Node4B>
    </Node4>
    <Node5>555</Node5>
    </Root>

    XML2 is:
    <Root>
    <Node1>111</Node1>
    <Node2>222New </Node2>
    <Node3>333</Node3>
    <Node4>
    <Node4A>444A</Node4A>
    <Node4B>444BNew </Node4B>
    </Node4>
    <Node5>555New </Node5>
    </Root>

    Essentially, what I want to do in my VB Dot Net application is to have
    XML2 - XML1, where the result would be:

    <Root>
    <Node2>222New </Node2>
    <Node4>
    <Node4B>444BNew </Node4B>
    </Node4>
    <Node5>555New </Node5>
    </Root>

    Only the differring nodes remain.

    Is something like this possible? Please Help.

    Thanks,
    ed
  • Oleg Tkachenko

    #2
    Re: HELP - Getting a Difference between XML documents?

    Ed wrote:
    [color=blue]
    > Only the differring nodes remain.
    >
    > Is something like this possible? Please Help.[/color]

    Take a look at Microsoft XML Diff tool -

    --
    Oleg Tkachenko

    Multiconn Technologies, Israel

    Comment

    • apm

      #3
      Re: HELP - Getting a Difference between XML documents?

      Oleg Tkachenko <oleg@NO_SPAM_P LEASEtkachenko. com> wrote in message news:<ehHPv6EYD HA.2464@TK2MSFT NGP09.phx.gbl>. ..[color=blue]
      > Ed wrote:
      >[color=green]
      > > Only the differring nodes remain.
      > >
      > > Is something like this possible? Please Help.[/color]
      >
      > Take a look at Microsoft XML Diff tool -
      > http://apps.gotdotnet.com/xmltools/xmldiff[/color]


      Now if only there was a platform-independent, GPL'd version :-)

      -Andrew Marlow

      Comment

      • Oleg Tkachenko

        #4
        Re: HELP - Getting a Difference between XML documents?

        apm wrote:
        [color=blue]
        > Now if only there was a platform-independent, GPL'd version :-)[/color]
        AFAIK java versions do exist also, from IBM alphaworks to mention one.
        --
        Oleg Tkachenko

        Multiconn Technologies, Israel

        Comment

        • Aleksi Kallio

          #5
          Re: HELP - Getting a Difference between XML documents?

          >>>Only the differring nodes remain.[color=blue][color=green][color=darkred]
          >>>Is something like this possible? Please Help.[/color]
          >>Take a look at Microsoft XML Diff tool -
          >>http://apps.gotdotnet.com/xmltools/xmldiff[/color]
          > Now if only there was a platform-independent, GPL'd version :-)[/color]

          How about X-Diff? It has C++ ja Java implementations and it's a real
          difference algorithm - most normal algorithms assume that the order of
          elements is significant, thus reducing the problem to finding the
          difference between two strings.

          But it is recommended that in XML the order of child elements would not
          be significant. In that case one might think that the task reduces to
          finding a difference between two trees - which is NP-Complete. However,
          by taking advantage of some properties of XML documents, X-Diff runs in
          polynomial time.

          http://www.cs.wisc.edu/~yuanwang/xdiff.html

          Comment

          • Ed

            #6
            Re: HELP - Getting a Difference between XML documents?

            Thanks for all the responses.. I'm gonna give the XML Diff tool a look!

            Aleksi Kallio <aleksi.kallio@ _DONT_SPAM_csc. fi> wrote in message news:<bhaj81$td o$1@newsread2.f unet.fi>...[color=blue][color=green][color=darkred]
            > >>>Only the differring nodes remain.
            > >>>Is something like this possible? Please Help.
            > >>Take a look at Microsoft XML Diff tool -
            > >>http://apps.gotdotnet.com/xmltools/xmldiff[/color]
            > > Now if only there was a platform-independent, GPL'd version :-)[/color]
            >
            > How about X-Diff? It has C++ ja Java implementations and it's a real
            > difference algorithm - most normal algorithms assume that the order of
            > elements is significant, thus reducing the problem to finding the
            > difference between two strings.
            >
            > But it is recommended that in XML the order of child elements would not
            > be significant. In that case one might think that the task reduces to
            > finding a difference between two trees - which is NP-Complete. However,
            > by taking advantage of some properties of XML documents, X-Diff runs in
            > polynomial time.
            >
            > http://www.cs.wisc.edu/~yuanwang/xdiff.html[/color]

            Comment

            Working...