1HTML::Lint::Error(3) User Contributed Perl Documentation HTML::Lint::Error(3)
2
3
4
6 HTML::Lint::Error - Error object for the Lint functionality
7
9 See HTML::Lint for all the gory details.
10
12 None. It's all object-based.
13
15 Almost everything is an accessor.
16
18 Each error has a type. Note that these roughly, but not exactly, go
19 from most severe to least severe.
20
21 · "STRUCTURE"
22
23 For problems that relate to the structural validity of the code.
24 Examples: Unclosed <TABLE> tags, incorrect values for attributes,
25 and repeated attributes.
26
27 · "HELPER"
28
29 Helpers are notes that will help you with your HTML, or that will
30 help the browser render the code better or faster. Example:
31 Missing HEIGHT and WIDTH attributes in an IMG tag.
32
33 · "FLUFF"
34
35 Fluff is for items that don't hurt your page, but don't help it
36 either. This is usually something like an unknown attribute on a
37 tag.
38
39 new()
40 Create an object. It's not very exciting.
41
42 is_type( $type1 [, $type2 ] )
43 Tells if any of $type1, $type2... match the error's type. Returns the
44 type that matched.
45
46 if ( $err->is_type( HTML::Lint::Error::STRUCTURE ) ) {....
47
48 where()
49 Returns a formatted string that describes where in the file the error
50 has occurred.
51
52 For example,
53
54 (14:23)
55
56 for line 14, column 23.
57
58 The terrible thing about this function is that it's both a plain ol'
59 formatting function as in
60
61 my $str = where( 14, 23 );
62
63 AND it's an object method, as in:
64
65 my $str = $error->where();
66
67 I don't know what I was thinking when I set it up this way, but it's
68 bad practice.
69
70 as_string()
71 Returns a nicely-formatted string for printing out to stdout or some
72 similar user thing.
73
74 file()
75 Returns the filename of the error, as set by the caller.
76
77 line()
78 Returns the line number of the error.
79
80 column()
81 Returns the column number, starting from 0
82
83 errcode()
84 Returns the HTML::Lint error code. Don't rely on this, because it will
85 probably go away.
86
87 errtext()
88 Descriptive text of the error
89
90 type()
91 Type of the error
92
94 None, other than incorporating more errors, as driven by HTML::Lint.
95
97 This code may be distributed under the same terms as Perl itself.
98
99 Please note that these modules are not products of or supported by the
100 employers of the various contributors to the code.
101
103 Andy Lester, "andy at petdance.com"
104
105
106
107perl v5.12.0 2008-12-08 HTML::Lint::Error(3)