--- test/html-webhacc/cc.cgi 2007/07/16 10:55:11 1.11 +++ test/html-webhacc/cc.cgi 2007/07/17 14:28:20 1.14 @@ -15,7 +15,9 @@ $s =~ s//>/g; $s =~ s/"/"/g; - $s =~ s!([\x00-\x09\x0B-\x1F\x7F-\x80])!sprintf 'U+%04X', ord $1!ge; + $s =~ s{([\x00-\x09\x0B-\x1F\x7F-\xA0\x{FEFF}\x{FFFC}-\x{FFFF}])}{ + sprintf 'U+%04X', ord $1; + }ge; return $s; } # htescape @@ -28,12 +30,12 @@ exit; } + binmode STDOUT, ':utf8'; + $| = 1; + require Message::DOM::DOMImplementation; my $dom = Message::DOM::DOMImplementation->new; - my $input = get_input_document ($http, $dom); - my $inner_html_element = $http->parameter ('e'); - load_text_catalog ('en'); ## TODO: conneg my @nav; @@ -46,8 +48,15 @@ -

Web Document Conformance Checker (beta)

+

Web Document Conformance Checker +(beta)

+]; + + $| = 0; + my $input = get_input_document ($http, $dom); + my $inner_html_element = $http->parameter ('e'); + print qq[
Request URI
@@ -207,6 +216,7 @@ if (@{$elements->{table}}) { require JSON; + push @nav, ['#tables' => 'Tables']; print STDOUT qq[

Tables

@@ -223,7 +233,9 @@ $i++; print STDOUT qq[

] . get_node_link ($table_el) . q[

]; - + + ## TODO: Make |ContentChecker| return |form_table| result + ## so that this script don't have to run the algorithm twice. my $table = Whatpm::HTMLTable->form_table ($table_el); for (@{$table->{column_group}}, @{$table->{column}}, $table->{caption}) { @@ -258,7 +270,25 @@ print STDOUT qq[
]; } + if (keys %{$elements->{id}}) { + push @nav, ['#identifiers' => 'IDs']; + print STDOUT qq[ +
+

Identifiers

+ +
+]; + for my $id (sort {$a cmp $b} keys %{$elements->{id}}) { + print STDOUT qq[
@{[htescape $id]}
]; + for (@{$elements->{id}->{$id}}) { + print STDOUT qq[
].get_node_link ($_).qq[
]; + } + } + print STDOUT qq[
]; + } + if (keys %{$elements->{term}}) { + push @nav, ['#terms' => 'Terms']; print STDOUT qq[

Terms

@@ -273,6 +303,23 @@ } print STDOUT qq[
]; } + + if (keys %{$elements->{class}}) { + push @nav, ['#classes' => 'Classes']; + print STDOUT qq[ +
+

Classes

+ +
+]; + for my $class (sort {$a cmp $b} keys %{$elements->{class}}) { + print STDOUT qq[
@{[htescape $class]}
]; + for (@{$elements->{class}->{$class}}) { + print STDOUT qq[
].get_node_link ($_).qq[
]; + } + } + print STDOUT qq[
]; + } } ## TODO: Show result @@ -669,4 +716,4 @@ =cut -## $Date: 2007/07/16 10:55:11 $ +## $Date: 2007/07/17 14:28:20 $