473,379 Members | 1,379 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,379 software developers and data experts.

algorithm on comparing two html files

ddd
I am trying to build a diff tool that allows me to compare two HTML files. I
am looking for resources on how to achive this. The main problem is that I do
not want to simply highlight the line of code where the change happened, but
rather the word/text that changed.

Example say the html file contains a table with three cells/one row, and all
that changes between the two HTML files that I want to compare is the value
on the second cell. I need to be able to distinuish that thats what changed,
even if the actual html code was one single line. (basically comparing what
is being rendered displayed by the HTML renderer).

Any ideas suggestions on where I can start looking ?

thanks
Nov 21 '05 #1
2 1324
ddd,

I think that I would try this in the most simple way first.
Just comparing two strings in a loop character by character.

(And don't think about speed.

This goes for any HTML file in less time, than the processing time when you
move any window).

I hope this helps,

Cor
Nov 21 '05 #2

"ddd" <dd*@discussions.microsoft.com> wrote in message
news:75**********************************@microsof t.com...
: I am trying to build a diff tool that allows me to compare two HTML
files. I
: am looking for resources on how to achive this. The main problem is
that I do
: not want to simply highlight the line of code where the change
happened, but
: rather the word/text that changed.
:
: Example say the html file contains a table with three cells/one row,
and all
: that changes between the two HTML files that I want to compare is the
value
: on the second cell. I need to be able to distinuish that thats what
changed,
: even if the actual html code was one single line. (basically comparing
what
: is being rendered displayed by the HTML renderer).
:
: Any ideas suggestions on where I can start looking ?
:
: thanks
If the two html files are identical in structure (differing the content
of various elements only ) and if two html files are valid XML (e.g.:
<br /> instead of <br>), they you can treat them as two xml files and
compare them accordingly.

Ralf
Nov 21 '05 #3

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

Similar topics

6
by: Els | last post by:
***newbie question*** Hi, I am trying to make my server (Apache) parse .html files as .php. I found this line of code: ForceType application/x-httpd-php placed it in an .htaccess file and...
18
by: David Johnson | last post by:
I am looking for a way to combine the functionality of "include" and "here documents" so that an included html file containing $variables is expanded and handled (normally printed to stdout). It...
1
by: Nick Leeson | last post by:
I have two HTML files - call it file1.html and file2.html.Is there a utility in Linux that I can use to visually compare the difference between the two files.Please note that I need to display and...
5
by: MK | last post by:
Dear friends, I have many HTML files and they all have some common HTML code which is basically bunch of tags which are in all the files. How can I put the common code in one file and then share...
1
by: ajk | last post by:
. Hi, All: I know how to insert files into a Word doc using C#. However, the program I've written to do this runs much too slowly. The "myObj".Application.Selection.InsertFile method executes...
4
by: ddd | last post by:
I am trying to build a diff tool that allows me to compare two HTML files. I am looking for resources on how to achive this. The main problem is that I do not want to simply highlight the line of...
4
by: Paul | last post by:
Hi still testing the idea of using html files for forms and then integrating this into a net app. I tried a small form with a button but noticed all I could do with the button is to right click and...
5
by: nick | last post by:
I need to create a simple asp.net application that use password protect some html pages. The html page provider doesn't know asp.net. And the host doesn't allow me to create user accounts. ...
3
by: =?Utf-8?B?UG9vamE=?= | last post by:
Hi I have been using Microsoft XmlDiffPatch to compare 2 XML files. I wanted to know if there is any Microsoft Tool which can be used to compare two HTML files in the similar manner or any...
1
by: Avi1 | last post by:
Hi, I got the code (from the internet)for comparing two files and showing the difference in contents.Now,I tried the same code for two files written in japanese language(kanji).If I save the two...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.