/[suikacvs]/markup/html/whatpm/Whatpm/ContentChecker.html
Suika

Contents of /markup/html/whatpm/Whatpm/ContentChecker.html

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download) (as text)
Sun Oct 5 05:59:35 2008 UTC (16 years, 1 month ago) by wakaba
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +100 -27 lines
File MIME type: text/html
++ whatpm/t/ChangeLog	5 Oct 2008 05:38:58 -0000
	* content-model-1.dat, content-model-2.dat: Test results on
	|label| contents fixed.

	* ContentChecker.t: |dom-conformance/html-form-label.dat| added.

	* dom-conformance/: New directory.

2008-10-05  Wakaba  <wakaba@suika.fam.cx>

++ whatpm/t/dom-conformance/ChangeLog	5 Oct 2008 05:35:48 -0000
2008-10-05  Wakaba  <wakaba@suika.fam.cx>

	* html-form-label.dat: New test data file.

	* ChangeLog: New file.

++ whatpm/Whatpm/ChangeLog	5 Oct 2008 05:58:50 -0000
	* ContentChecker.pod: Note on internal flags is added.

2008-10-05  Wakaba  <wakaba@suika.fam.cx>

++ whatpm/Whatpm/ContentChecker/ChangeLog	5 Oct 2008 05:36:36 -0000
2008-10-05  Wakaba  <wakaba@suika.fam.cx>

	* HTML.pm: <label> content conformance checking implemented.

1 <?xml version="1.0" ?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml">
4 <head>
5 <title>Whatpm::ContentChecker - DOM Conformance Checker</title>
6 <link rel="stylesheet" href="http://suika.fam.cx/www/style/html/pod.css" type="text/css" />
7 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
8 <link rev="made" href="mailto:wakaba@suika.fam.cx" />
9 </head>
10
11 <body>
12
13
14 <!-- INDEX BEGIN -->
15 <div name="index">
16 <p><a name="__index__"></a></p>
17
18 <ul>
19
20 <li><a href="#name">NAME</a></li>
21 <li><a href="#synopsis">SYNOPSIS</a></li>
22 <li><a href="#description">DESCRIPTION</a></li>
23 <li><a href="#methods">METHODS</a></li>
24 <li><a href="#bugs">BUGS</a></li>
25 <li><a href="#notes_on_implementation_details">NOTES ON IMPLEMENTATION DETAILS</a></li>
26 <ul>
27
28 <li><a href="#the__self___flag__structure">The <code>$self-&gt;{flag}</code> Structure</a></li>
29 <li><a href="#the__element_state_structure">The <code>$element_state</code> Structure</a></li>
30 </ul>
31
32 <li><a href="#see_also">SEE ALSO</a></li>
33 <li><a href="#author">AUTHOR</a></li>
34 <li><a href="#license">LICENSE</a></li>
35 </ul>
36
37 <hr name="index" />
38 </div>
39 <!-- INDEX END -->
40
41 <p>
42 </p>
43 <h1><a name="name">NAME</a></h1>
44 <p>Whatpm::ContentChecker - DOM Conformance Checker</p>
45 <p>
46 </p>
47 <hr />
48 <h1><a name="synopsis">SYNOPSIS</a></h1>
49 <pre>
50 use Whatpm::ContentChecker;
51
52 Whatpm::ContentChecker-&gt;check_document ($doc, sub {
53 my %arg = @_;
54 warn get_node_path ($arg{node}), &quot;: &quot;,
55 ($arg{level} || &quot;Error&quot;), &quot;: &quot;,
56 $arg{type}, &quot;\n&quot;;
57 });
58
59 Whatpm::ContentChecker-&gt;check_element ($doc, sub {
60 my %arg = @_;
61 warn get_node_path ($arg{node}), &quot;: &quot;,
62 ($arg{level} || &quot;Error&quot;), &quot;: &quot;,
63 $arg{type}, &quot;\n&quot;;
64 });</pre>
65 <p>
66 </p>
67 <hr />
68 <h1><a name="description">DESCRIPTION</a></h1>
69 <p>The <code>Whatpm::ContentChecker</code> Perl module contains two methods
70 to validate DOM tree for its conformance to the markup language
71 in use.</p>
72 <p>This module is part of Whatpm, Perl Modules for
73 Web Hypertext Application Technologies, which is a subproject
74 of manakai.</p>
75 <p>
76 </p>
77 <hr />
78 <h1><a name="methods">METHODS</a></h1>
79 <p>This module contains two static methods:</p>
80 <dl>
81 <dt><strong><a name="check_document" class="item">Whatpm::ContentChecker-&gt;check_document (<em>$document</em>, <em>$onerror</em>);</a></strong>
82
83 <dd>
84 <p>Checks a document, <em>$document</em>, and its descendant for their
85 conformance. If there is an error or a warnign, then the
86 <em>$onerror</em> <code>CODE</code> is invoked with named arguments same
87 as ones for the method <a href="#check_element"><code>check_element</code></a>.</p>
88 </dd>
89 </li>
90 <dt><strong><a name="check_element" class="item">Whatpm::ContentChecker-&gt;check_element (<em>$element</em>, <em>$onerror</em>);</a></strong>
91
92 <dd>
93 <p>Checks an element, <em>$element</em>, and its descendant for their conformance.
94 If there is an error or a warning, then the <em>$onerror</em> <code>CODE</code>
95 is invoked with named arguments:</p>
96 </dd>
97 <dl>
98 <dt><strong><a name="level" class="item">level (Might be <code>undef</code>)</a></strong>
99
100 <dd>
101 <p>A string which describes the severity of the error or warning.
102 For the list of the severities, see
103 &lt;http://suika.fam.cx/gate/2005/sw/Whatpm%20Error%20Types&gt;.</p>
104 </dd>
105 </li>
106 <dt><strong><a name="node" class="item">node (Always specified)</a></strong>
107
108 <dd>
109 <p>The node with which the error is detected.</p>
110 </dd>
111 </li>
112 <dt><strong><a name="type" class="item">type (Always specified)</a></strong>
113
114 <dd>
115 <p>A string which describes the type of the error or warning.
116 For the list of the errors and warnings, see
117 &lt;http://suika.fam.cx/gate/2005/sw/Whatpm%20Error%20Types&gt;.</p>
118 </dd>
119 </li>
120 </dl>
121 </dl>
122 <p>
123 </p>
124 <hr />
125 <h1><a name="bugs">BUGS</a></h1>
126 <p>This conformance checker is work in progress; it <em>might</em> not be
127 able to detect all the errors in the DOM tree, and it <em>might</em>
128 detect an error for a node that is conforming in fact.</p>
129 <p>
130 </p>
131 <hr />
132 <h1><a name="notes_on_implementation_details">NOTES ON IMPLEMENTATION DETAILS</a></h1>
133 <p><em>This section is not complete.</em></p>
134 <p>This section describes various internal constructions used in
135 <a href="../Whatpm/ContentChecker.html">the Whatpm::ContentChecker manpage</a> and relevant modules. These data structures
136 are not public interfaces -- they should not be accessed or modified
137 by applications. They are documented here for the convenience of
138 development only.</p>
139 <p>
140 </p>
141 <h2><a name="the__self___flag__structure">The <code>$self-&gt;{flag}</code> Structure</a></h2>
142 <dl>
143 <dt><strong><a name="_self___flag____has_label_" class="item"><code>$self-&gt;{flag}-&gt;{has_label}</code></a></strong>
144
145 <dd>
146 <p>This flag is set to a true value if and only if there is a <code>label</code>
147 element ancestor of the current node.</p>
148 </dd>
149 </li>
150 <dt><strong><a name="_self___flag____has_labelable_" class="item"><code>$self-&gt;{flag}-&gt;{has_labelable}</code></a></strong>
151
152 <dd>
153 <p>This flag is set to <code>1</code> if and only if a nearest ancestor <code>label</code>
154 element has the <code>for</code> attribute and there is no labelable
155 form-associated element that is a descendant of the <code>label</code> element
156 and precedes the current node in tree order. This flag is set to <code>2</code>
157 if and only if there is a labelable form-associated element that is a
158 descendant of the nearest ancestor <code>label</code> element of the current
159 node and precedes the current node in tree order. This flag is
160 otherwise set to a false value. <strong>However</strong>, when there is no ancestor
161 <code>label</code> element of the current node, i.e. when
162 <a href="#_self___flag____has_label_"><code>$self-&gt;{flag}-&gt;{has_label}</code></a> is false, the value of the
163 <a href="#_self___flag____has_labelable_"><code>$self-&gt;{flag}-&gt;{has_labelable}</code></a> flag is <em>undefined</em>.</p>
164 </dd>
165 </li>
166 </dl>
167 <p>
168 </p>
169 <h2><a name="the__element_state_structure">The <code>$element_state</code> Structure</a></h2>
170 <dl>
171 <dt><strong><a name="_element_state___has_label_original_" class="item"><code>$element_state-&gt;{has_label_original}</code></a></strong>
172
173 <dd>
174 <p>Used to preserve the value of <a href="#_self___flag____has_label_"><code>$self-&gt;{flag}-&gt;{has_label}</code></a> at the
175 time of invocation of the method <code>element_start</code> for the element
176 being checked.</p>
177 </dd>
178 </li>
179 <dt><strong><a name="_element_state___has_labelable_original_" class="item"><code>$element_state-&gt;{has_labelable_original}</code></a></strong>
180
181 <dd>
182 <p>Used to preserve the value of <a href="#_self___flag____has_labelable_"><code>$self-&gt;{flag}-&gt;{has_labelable}</code></a> at
183 the time of invocation of the method <code>element_start</code> for the element
184 being checked.</p>
185 </dd>
186 </li>
187 </dl>
188 <p>
189 </p>
190 <hr />
191 <h1><a name="see_also">SEE ALSO</a></h1>
192 <p><a href="../Whatpm/ContentChecker/Atom.html">the Whatpm::ContentChecker::Atom manpage</a></p>
193 <p><a href="../Whatpm/ContentChecker/HTML.html">the Whatpm::ContentChecker::HTML manpage</a></p>
194 <p>&lt;http://suika.fam.cx/gate/2005/sw/Whatpm%20Error%20Types&gt;</p>
195 <p>
196 </p>
197 <hr />
198 <h1><a name="author">AUTHOR</a></h1>
199 <p>Wakaba &lt;<a href="mailto:w@suika.fam.cx">w@suika.fam.cx</a>&gt;</p>
200 <p>
201 </p>
202 <hr />
203 <h1><a name="license">LICENSE</a></h1>
204 <p>Copyright 2007-2008 Wakaba &lt;<a href="mailto:w@suika.fam.cx">w@suika.fam.cx</a>&gt;</p>
205 <p>This library is free software; you can redistribute it
206 and/or modify it under the same terms as Perl itself.</p>
207
208 </body>
209
210 </html>

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24