This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 4412 - Fuzzy-match nonexistent tag and attribute names (did you mean?...)
Summary: Fuzzy-match nonexistent tag and attribute names (did you mean?...)
Status: RESOLVED FIXED
Alias: None
Product: Validator
Classification: Unclassified
Component: check (show other bugs)
Version: 0.7.4
Hardware: All All
: P2 enhancement
Target Milestone: 1.0
Assignee: Olivier Thereaux
QA Contact: qa-dev tracking
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-22 02:03 UTC by Olivier Thereaux
Modified: 2009-02-13 21:14 UTC (History)
0 users

See Also:


Attachments

Description Olivier Thereaux 2007-03-22 02:03:44 UTC
Quite often users of the validator get puzzled at "there is no such attribute oNClick", because of case-sensitivity of XHTML, or other such typos.

A useful feature would be to append to the message
there is no attribute "onMouseover"
a fuzzy-match saying: 
did you mean "onmouseover?
Comment 1 Olivier Thereaux 2007-03-22 02:07:22 UTC
What that would imply on the technical side is:
* a dictionary of all elements and attributes, from the DTD of the document type used
* a fuzzy-matching engine comparing the offending element/attribute with the dictionary

The former is relatively easy to build. Anyone knows of a good implementation of the latter, in CPAN if possible?
Comment 2 Ville Skyttä 2007-03-22 16:02:44 UTC
Maybe this or some of the other modules it mentions?
http://search.cpan.org/dist/String-Approx/Approx.pm
Comment 3 Olivier Thereaux 2009-02-13 19:13:08 UTC
(In reply to comment #2)
> Maybe this or some of the other modules it mentions?
> http://search.cpan.org/dist/String-Approx/Approx.pm


String::Approx is not bad. I got some confusing results at frist but after a bit of wrangling I find it reasonably effective.