--- test/html-webhacc/cc.cgi 2008/02/10 02:42:01 1.33 +++ test/html-webhacc/cc.cgi 2008/02/10 03:11:06 1.34 @@ -155,6 +155,7 @@ my $doc; my $el; my $manifest; + my @subdoc; if ($input->{media_type} eq 'text/html') { ($doc, $el) = print_syntax_error_html_section ($input, $result); @@ -180,9 +181,13 @@ } if (defined $doc or defined $el) { + $doc->document_uri ($input->{uri}); + $doc->manakai_entity_base_uri ($input->{base_uri}); print_structure_dump_dom_section ($input, $doc, $el); my $elements = print_structure_error_dom_section - ($input, $doc, $el, $result); + ($input, $doc, $el, $result, sub { + push @subdoc, shift; + }); print_table_section ($input, $elements->{table}) if @{$elements->{table}}; print_listing_section ({ id => 'identifiers', label => 'IDs', heading => 'Identifiers', @@ -197,13 +202,38 @@ print_structure_dump_manifest_section ($input, $manifest); print_structure_error_manifest_section ($input, $manifest, $result); } + + my $id_prefix = 0; + for my $subinput (@subdoc) { + $subinput->{id_prefix} = 'subdoc-' . ++$id_prefix; + $subinput->{nested} = 1; + $subinput->{base_uri} = $subinput->{container_node}->base_uri + unless defined $subinput->{base_uri}; + my $ebaseuri = htescape ($subinput->{base_uri}); + push @nav, ['#' . $subinput->{id_prefix} => 'Sub #' . $id_prefix]; + print STDOUT qq[
+

Subdocument #$id_prefix

+ +
+
Internet Media Type
+
@{[htescape $subinput->{media_type}]} +
Container Node
+
@{[get_node_link ($input, $subinput->{container_node})]}
+
Base URI
+
<$ebaseuri>
+
]; + + check_and_print ($subinput => $result); + + print STDOUT qq[
]; + } } # check_and_print sub print_http_header_section ($$) { my ($input, $result) = @_; return unless defined $input->{header_status_code} or defined $input->{header_status_text} or - @{$input->{header_field}}; + @{$input->{header_field} or []}; push @nav, ['#source-header' => 'HTTP Header'] unless $input->{nested}; print STDOUT qq[
@@ -537,8 +567,8 @@ print STDOUT qq[
]; } # print_structure_dump_manifest_section -sub print_structure_error_dom_section ($$$$) { - my ($input, $doc, $el, $result) = @_; +sub print_structure_error_dom_section ($$$$$) { + my ($input, $doc, $el, $result, $onsubdoc) = @_; print STDOUT qq[

Document Errors

@@ -562,9 +592,11 @@ my $elements; my $time1 = time; if ($el) { - $elements = Whatpm::ContentChecker->check_element ($el, $onerror); + $elements = Whatpm::ContentChecker->check_element + ($el, $onerror, $onsubdoc); } else { - $elements = Whatpm::ContentChecker->check_document ($doc, $onerror); + $elements = Whatpm::ContentChecker->check_document + ($doc, $onerror, $onsubdoc); } $time{check} = time - $time1; @@ -1131,4 +1163,4 @@ =cut -## $Date: 2008/02/10 02:42:01 $ +## $Date: 2008/02/10 03:11:06 $