The Artima Developer Community
Sponsored Link

Python Buzz Forum
New feature for the day

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Ian Bicking

Posts: 900
Nickname: ianb
Registered: Apr, 2003

Ian Bicking is a freelance programmer
New feature for the day Posted: Apr 14, 2004 10:06 AM
Reply to this message Reply

This post originated from an RSS feed registered with Python Buzz by Ian Bicking.
Original Post: New feature for the day
Feed Title: Ian Bicking
Feed URL: http://www.ianbicking.org/feeds/atom.xml
Feed Description: Thoughts on Python and Programming.
Latest Python Buzz Posts
Latest Python Buzz Posts by Ian Bicking
Latest Posts From Ian Bicking

Advertisement

The new feature in the wiki for today is version comparisons.

This uses htmldiff.py to do the comparisons. Unlike some other comparisons, htmldiff calculates the differences between HTML documents, instead of relying on line-by-line comparisons of the original text source. Since HTML isn't (very) whitespace sensitive, comparisons based on line endings or other whitespace aren't really accurate. Instead htmldiff parses the HTML into a list of tokens -- one token for each start and end tag, and one token for each whitespace-delimited word in the text (it essentially ignores the nested structure of HTML and treats it as a simple stream of tokens).

This seems like a good compromise to me. Character level comparisons ignore the structure of HTML completely, and tend to create weird differences. Line level comparisons aren't appropriate to HTML or narrative text. Structured comparisons like XmlDiff are too complicated to present in a visually simple way.

Read: New feature for the day

Topic: Got me a bug tracker Previous Topic   Next Topic Topic: String Munging and Webware Munging

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use