16 |
require Whatpm::HTML; |
require Whatpm::HTML; |
17 |
|
|
18 |
my $out = $self->output; |
my $out = $self->output; |
19 |
$out->start_section (id => 'parse-errors', title => 'Parse Errors'); |
$out->start_section (role => 'parse-errors'); |
20 |
$out->start_tag (id => 'parse-errors-list'); |
$out->start_error_list (role => 'parse-errors'); |
21 |
|
|
22 |
my $input = $self->input; |
my $input = $self->input; |
23 |
my $result = $self->result; |
my $result = $self->result; |
24 |
|
|
25 |
my $onerror = sub { |
my $onerror = sub { |
26 |
my (%opt) = @_; |
$result->add_error (@_, layer => 'syntax'); |
|
my ($type, $cls, $msg) = main::get_text ($opt{type}, $opt{level}); |
|
|
$out->html (qq[<dt class="$cls">] . $result->get_error_label ($input, \%opt)); |
|
|
$type =~ tr/ /-/; |
|
|
$type =~ s/\|/%7C/g; |
|
|
$out->html (qq[<dd class="$cls">] . $result->get_error_level_label (\%opt) , $msg); |
|
|
$out->text (' ['); |
|
|
$out->link ('Description', |
|
|
url => '../error-description#' . $type); |
|
|
$out->text (']'); |
|
|
|
|
|
main::add_error ('syntax', \%opt => $result); |
|
27 |
}; |
}; |
28 |
|
|
29 |
my $dom = Message::DOM::DOMImplementation->new; |
my $dom = Message::DOM::DOMImplementation->new; |
58 |
$doc->document_uri ($input->{uri}); |
$doc->document_uri ($input->{uri}); |
59 |
$doc->manakai_entity_base_uri ($input->{base_uri}); |
$doc->manakai_entity_base_uri ($input->{base_uri}); |
60 |
|
|
61 |
$out->end_tag ('dl'); |
$out->end_error_list (role => 'parse-errors'); |
62 |
$out->end_section; |
$out->end_section; |
63 |
} # generate_syntax_error_section |
} # generate_syntax_error_section |
64 |
|
|