| 72 |
|
|
| 73 |
my $out = $self->output; |
my $out = $self->output; |
| 74 |
|
|
| 75 |
$out->start_section (id => 'document-errors', title => 'Document Errors'); |
$out->start_section (role => 'structure-errors'); |
| 76 |
$out->html ('<p>Not supported for this kind of contents.'); |
$out->start_error_list (role => 'structure-errors'); |
| 77 |
## TODO: class="???" |
$self->result->layer_applicable ('structure'); |
| 78 |
|
|
| 79 |
|
$self->result->add_error (input => $self->input, |
| 80 |
|
level => 'u', |
| 81 |
|
layer => 'structure', |
| 82 |
|
type => 'media type not supported:structure', |
| 83 |
|
text => $self->input->{media_type}); |
| 84 |
|
|
| 85 |
|
$out->end_error_list (role => 'structure-errors'); |
| 86 |
$out->end_section; |
$out->end_section; |
| 87 |
|
|
| 88 |
|
$self->result->layer_uncertain ('semantics'); |
| 89 |
} # generate_structure_error_section |
} # generate_structure_error_section |
| 90 |
|
|
| 91 |
sub source_charset ($) { |
sub source_charset ($) { |
| 115 |
|
|
| 116 |
my $t = ''; |
my $t = ''; |
| 117 |
while (1) { |
while (1) { |
| 118 |
my $c = $char_stream->getc; |
if ($char_stream->read ($t, 1024, length $t)) { |
| 119 |
last unless defined $c; |
# |
| 120 |
$t .= $c; |
} else { |
| 121 |
|
last; |
| 122 |
|
} |
| 123 |
} |
} |
| 124 |
$s = \$t; |
$s = \$t; |
| 125 |
## TODO: Output for each line, don't concat all of lines. |
## TODO: Output for each line, don't concat all of lines. |
| 129 |
|
|
| 130 |
my $out = $self->output; |
my $out = $self->output; |
| 131 |
my $i = 1; |
my $i = 1; |
| 132 |
$out->start_section (id => 'source-string', title => 'Document Source', |
$out->start_section (role => 'source'); |
|
short_title => 'Source'); |
|
| 133 |
$out->start_tag ('ol', lang => ''); |
$out->start_tag ('ol', lang => ''); |
| 134 |
|
|
| 135 |
if (length $$s) { |
if (length $$s) { |
| 146 |
$out->start_tag ('li', id => 'line-1'); |
$out->start_tag ('li', id => 'line-1'); |
| 147 |
} |
} |
| 148 |
$out->end_tag ('ol'); |
$out->end_tag ('ol'); |
| 149 |
$out->html (qq[<script> |
$out->add_source_to_parse_error_list ('parse-errors-list'); |
| 150 |
addSourceToParseErrorList ('@{[$input->id_prefix]}', 'parse-errors-list'); |
$out->end_section; |
|
</script>]); |
|
|
$out->end_section |
|
| 151 |
} # generate_source_string_section |
} # generate_source_string_section |
| 152 |
|
|
| 153 |
sub generate_additional_sections ($) { |
sub generate_additional_sections ($) { |
| 178 |
$out->link_to_webhacc ('Check conformance of this document', url => $url); |
$out->link_to_webhacc ('Check conformance of this document', url => $url); |
| 179 |
$out->html ('<dd>Found in: <ul>'); |
$out->html ('<dd>Found in: <ul>'); |
| 180 |
for my $entry (@{$urls->{$url}}) { |
for my $entry (@{$urls->{$url}}) { |
| 181 |
$out->html (qq[<li>] . $result->get_node_link ($input, $entry->{node})); |
$out->start_tag ('li'); |
| 182 |
|
$out->node_link ($entry->{node}); |
| 183 |
if (keys %{$entry->{type} or {}}) { |
if (keys %{$entry->{type} or {}}) { |
| 184 |
$out->text (' ('); |
$out->text (' ('); |
| 185 |
$out->text (join ', ', map { |
$out->text (join ', ', map { |