--- test/html-webhacc/cc.cgi 2007/09/02 08:40:49 1.18
+++ test/html-webhacc/cc.cgi 2007/11/05 09:33:52 1.23
@@ -1,5 +1,6 @@
#!/usr/bin/perl
use strict;
+use utf8;
use lib qw[/home/httpd/html/www/markup/html/whatpm
/home/wakaba/work/manakai2/lib];
@@ -83,13 +84,15 @@
];
- print_http_header_section ($input);
+ my $result = {conforming_min => 1, conforming_max => 1};
+ print_http_header_section ($input, $result);
my $doc;
my $el;
+ my $manifest;
if ($input->{media_type} eq 'text/html') {
- ($doc, $el) = print_syntax_error_html_section ($input);
+ ($doc, $el) = print_syntax_error_html_section ($input, $result);
print_source_string_section (\($input->{s}), $input->{charset});
} elsif ({
'text/xml' => 1,
@@ -99,23 +102,30 @@
'application/xhtml+xml' => 1,
'application/xml' => 1,
}->{$input->{media_type}}) {
- ($doc, $el) = print_syntax_error_xml_section ($input);
+ ($doc, $el) = print_syntax_error_xml_section ($input, $result);
print_source_string_section (\($input->{s}), $doc->input_encoding);
+ } elsif ($input->{media_type} eq 'text/cache-manifest') {
+## TODO: MUST be text/cache-manifest
+ $manifest = print_syntax_error_manifest_section ($input, $result);
+ print_source_string_section (\($input->{s}), 'utf-8');
} else {
## TODO: Change HTTP status code??
print_result_unknown_type_section ($input);
}
if (defined $doc or defined $el) {
- print_structure_dump_section ($doc, $el);
- my $elements = print_structure_error_section ($doc, $el);
+ print_structure_dump_dom_section ($doc, $el);
+ my $elements = print_structure_error_dom_section ($doc, $el, $result);
print_table_section ($elements->{table}) if @{$elements->{table}};
print_id_section ($elements->{id}) if keys %{$elements->{id}};
print_term_section ($elements->{term}) if keys %{$elements->{term}};
print_class_section ($elements->{class}) if keys %{$elements->{class}};
+ } elsif (defined $manifest) {
+ print_structure_dump_manifest_section ($manifest);
+ print_structure_error_manifest_section ($manifest, $result);
}
- ## TODO: Show result
+ print_result_section ($result);
} else {
print STDOUT qq[];
print_result_input_error_section ($input);
@@ -133,7 +143,7 @@