1 |
wakaba |
1.1 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
2 |
|
|
<html xmlns="http://www.w3.org/1999/xhtml"> |
3 |
|
|
<head> |
4 |
|
|
<title>Whatpm::ContentChecker - DOM Conformance Checker</title> |
5 |
|
|
<link rel="stylesheet" href="http://suika.fam.cx/www/style/html/pod.css" type="text/css" /> |
6 |
|
|
<link rev="made" href="mailto:admin@suika.fam.cx" /> |
7 |
|
|
</head> |
8 |
|
|
|
9 |
|
|
<body> |
10 |
|
|
|
11 |
|
|
<p><a name="__index__"></a></p> |
12 |
|
|
<!-- INDEX BEGIN --> |
13 |
|
|
|
14 |
|
|
<ul> |
15 |
|
|
|
16 |
|
|
<li><a href="#name">NAME</a></li> |
17 |
|
|
<li><a href="#synopsis">SYNOPSIS</a></li> |
18 |
|
|
<li><a href="#description">DESCRIPTION</a></li> |
19 |
|
|
<li><a href="#methods">METHODS</a></li> |
20 |
|
|
<li><a href="#bugs">BUGS</a></li> |
21 |
|
|
<li><a href="#see_also">SEE ALSO</a></li> |
22 |
|
|
<li><a href="#author">AUTHOR</a></li> |
23 |
|
|
<li><a href="#license">LICENSE</a></li> |
24 |
|
|
</ul> |
25 |
|
|
<!-- INDEX END --> |
26 |
|
|
|
27 |
|
|
<hr /> |
28 |
|
|
<p> |
29 |
|
|
</p> |
30 |
|
|
<h1><a name="name">NAME</a></h1> |
31 |
|
|
<p>Whatpm::ContentChecker - DOM Conformance Checker</p> |
32 |
|
|
<p> |
33 |
|
|
</p> |
34 |
|
|
<hr /> |
35 |
|
|
<h1><a name="synopsis">SYNOPSIS</a></h1> |
36 |
|
|
<pre> |
37 |
|
|
use Whatpm::ContentChecker; |
38 |
|
|
|
39 |
|
|
Whatpm::ContentChecker->check_document ($doc, sub { |
40 |
|
|
my %arg = @_; |
41 |
|
|
warn get_node_path ($arg{node}), ": ", |
42 |
|
|
($arg{level} || "Error"), ": ", |
43 |
|
|
$arg{type}, "\n"; |
44 |
|
|
}); |
45 |
|
|
|
46 |
|
|
Whatpm::ContentChecker->check_element ($doc, sub { |
47 |
|
|
my %arg = @_; |
48 |
|
|
warn get_node_path ($arg{node}), ": ", |
49 |
|
|
($arg{level} || "Error"), ": ", |
50 |
|
|
$arg{type}, "\n"; |
51 |
|
|
});</pre> |
52 |
|
|
<p> |
53 |
|
|
</p> |
54 |
|
|
<hr /> |
55 |
|
|
<h1><a name="description">DESCRIPTION</a></h1> |
56 |
|
|
<p>The <code>Whatpm::ContentChecker</code> Perl module contains two methods |
57 |
|
|
to validate DOM tree for its conformance to the markup language |
58 |
|
|
in use.</p> |
59 |
|
|
<p>This module is part of Whatpm, Perl Modules for |
60 |
|
|
Web Hypertext Application Technologies, which is a subproject |
61 |
|
|
of manakai.</p> |
62 |
|
|
<p> |
63 |
|
|
</p> |
64 |
|
|
<hr /> |
65 |
|
|
<h1><a name="methods">METHODS</a></h1> |
66 |
|
|
<p>This module contains two static methods:</p> |
67 |
|
|
<dl> |
68 |
|
|
<dt><strong><a name="item_check_document">Whatpm::ContentChecker->check_document (<em>$document</em>, <em>$onerror</em>);</a></strong><br /> |
69 |
|
|
</dt> |
70 |
|
|
<dd> |
71 |
|
|
Checks a document, <em>$document</em>, and its descendant for their |
72 |
|
|
conformance. If there is an error or a warnign, then the |
73 |
|
|
<em>$onerror</em> <code>CODE</code> is invoked with named arguments same |
74 |
|
|
as ones for the method <a href="#item_check_element"><code>check_element</code></a>. |
75 |
|
|
</dd> |
76 |
|
|
<p></p> |
77 |
|
|
<dt><strong><a name="item_check_element">Whatpm::ContentChecker->check_element (<em>$element</em>, <em>$onerror</em>);</a></strong><br /> |
78 |
|
|
</dt> |
79 |
|
|
<dd> |
80 |
|
|
Checks an element, <em>$element</em>, and its descendant for their conformance. |
81 |
|
|
If there is an error or a warning, then the <em>$onerror</em> <code>CODE</code> |
82 |
|
|
is invoked with named arguments: |
83 |
|
|
</dd> |
84 |
|
|
<dl> |
85 |
|
|
<dt><strong><a name="item_level">level (Might be <code>undef</code>)</a></strong><br /> |
86 |
|
|
</dt> |
87 |
|
|
<dd> |
88 |
|
|
A string which describes the severity of the error or warning. |
89 |
|
|
For the list of the severities, see |
90 |
|
|
<http://suika.fam.cx/gate/2005/sw/Whatpm%20Error%20Types>. |
91 |
|
|
</dd> |
92 |
|
|
<p></p> |
93 |
|
|
<dt><strong><a name="item_node">node (Always specified)</a></strong><br /> |
94 |
|
|
</dt> |
95 |
|
|
<dd> |
96 |
|
|
The node with which the error is detected. |
97 |
|
|
</dd> |
98 |
|
|
<p></p> |
99 |
|
|
<dt><strong><a name="item_type">type (Always specified)</a></strong><br /> |
100 |
|
|
</dt> |
101 |
|
|
<dd> |
102 |
|
|
A string which describes the type of the error or warning. |
103 |
|
|
For the list of the errors and warnings, see |
104 |
|
|
<http://suika.fam.cx/gate/2005/sw/Whatpm%20Error%20Types>. |
105 |
|
|
</dd> |
106 |
|
|
<p></p></dl> |
107 |
|
|
</dl> |
108 |
|
|
<p> |
109 |
|
|
</p> |
110 |
|
|
<hr /> |
111 |
|
|
<h1><a name="bugs">BUGS</a></h1> |
112 |
|
|
<p>This conformance checker is work in progress; it <em>might</em> not be |
113 |
|
|
able to detect all the errors in the DOM tree, and it <em>might</em> |
114 |
|
|
detect an error for a node that is conforming in fact.</p> |
115 |
|
|
<p> |
116 |
|
|
</p> |
117 |
|
|
<hr /> |
118 |
|
|
<h1><a name="see_also">SEE ALSO</a></h1> |
119 |
|
|
<p><a href="../Whatpm/ContentChecker/Atom.html">the Whatpm::ContentChecker::Atom manpage</a></p> |
120 |
|
|
<p><a href="../Whatpm/ContentChecker/HTML.html">the Whatpm::ContentChecker::HTML manpage</a></p> |
121 |
|
|
<p><http://suika.fam.cx/gate/2005/sw/Whatpm%20Error%20Types></p> |
122 |
|
|
<p> |
123 |
|
|
</p> |
124 |
|
|
<hr /> |
125 |
|
|
<h1><a name="author">AUTHOR</a></h1> |
126 |
|
|
<p>Wakaba <<a href="mailto:w@suika.fam.cx">w@suika.fam.cx</a>></p> |
127 |
|
|
<p> |
128 |
|
|
</p> |
129 |
|
|
<hr /> |
130 |
|
|
<h1><a name="license">LICENSE</a></h1> |
131 |
|
|
<p>Copyright 2007 Wakaba <<a href="mailto:w@suika.fam.cx">w@suika.fam.cx</a>></p> |
132 |
|
|
<p>This library is free software; you can redistribute it |
133 |
|
|
and/or modify it under the same terms as Perl itself.</p> |
134 |
|
|
|
135 |
|
|
</body> |
136 |
|
|
|
137 |
|
|
</html> |