Is there any utility / code that will return a file containing the *content* differences in two HTML

Discussion in 'Java' started by balma, Jul 13, 2003.

  1. balma

    balma Guest

    Hi
    I needed to know if there is a code that will return the textual
    differences in two HTML pages.
    Am curious to know what kind of algorithm does that require
    I do have an HTML parser library with me - but don't have an idea on
    what kind of algorithm to utilise
    Thanks for any suggestions
    balma, Jul 13, 2003
    #1
    1. Advertising

  2. balma:

    >I needed to know if there is a code that will return the textual
    >differences in two HTML pages.
    >Am curious to know what kind of algorithm does that require
    >I do have an HTML parser library with me - but don't have an idea on
    >what kind of algorithm to utilise


    You'll have to throw away the markup and then normalize the texts,
    replacing all sequences of whitespace characters with a single space
    character - if that doesn't get into the way of the comparison. Maybe
    you _do_ care about whitespace.

    There is diff, a tool that determines the differences between two
    texts. IIRC there is a Java implementation of diff.

    Do you need all differences, or some percentage value of similarity,
    or a simple decision "texts are equal" / "texts are not equal"?

    Regards,
    Marco
    --
    Please reply in the newsgroup, not by email!
    Java programming tips: http://jiu.sourceforge.net/javatips.html
    Other Java pages: http://www.geocities.com/marcoschmidt.geo/java.html
    Marco Schmidt, Jul 13, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Melinda
    Replies:
    2
    Views:
    291
    =?Utf-8?B?RGF2aWQ=?=
    Feb 7, 2005
  2. balma
    Replies:
    0
    Views:
    282
    balma
    Jul 13, 2003
  3. Replies:
    10
    Views:
    536
    Robert Kern
    Apr 9, 2008
  4. Home_Job_opportunity
    Replies:
    0
    Views:
    496
    Home_Job_opportunity
    Jan 8, 2009
  5. hiral
    Replies:
    5
    Views:
    2,171
    Paul Rudin
    Jun 15, 2010
Loading...

Share This Page