54 |
my $class = qq[level-$error_level layer-$error_layer]; |
my $class = qq[level-$error_level layer-$error_layer]; |
55 |
|
|
56 |
$out->start_tag ('dt', class => $class); |
$out->start_tag ('dt', class => $class); |
57 |
|
my $has_location; |
58 |
|
|
59 |
## URL |
## URL |
60 |
|
|
61 |
if (defined $opt{url}) { |
if (defined $opt{url}) { |
62 |
$out->url ($opt{url}); |
$out->url ($opt{url}); |
63 |
|
$has_location = 1; |
64 |
} |
} |
65 |
|
|
66 |
## Line & column number |
## Line & column number |
106 |
$line = $line - 1 || 1; |
$line = $line - 1 || 1; |
107 |
$out->xref ('Line ' . $line, target => 'line-' . $line); |
$out->xref ('Line ' . $line, target => 'line-' . $line); |
108 |
} |
} |
109 |
|
$has_location = 1; |
110 |
} |
} |
111 |
|
|
112 |
## Node path |
## Node path |
114 |
if (defined $opt{node}) { |
if (defined $opt{node}) { |
115 |
$out->html (' '); |
$out->html (' '); |
116 |
$out->node_link ($opt{node}); |
$out->node_link ($opt{node}); |
117 |
|
$has_location = 1; |
118 |
} |
} |
119 |
|
|
120 |
if (defined $opt{index}) { |
if (defined $opt{index}) { |
125 |
} else { |
} else { |
126 |
$out->text (' Index ' . (0+$opt{index})); |
$out->text (' Index ' . (0+$opt{index})); |
127 |
} |
} |
128 |
|
$has_location = 1; |
129 |
} |
} |
130 |
|
|
131 |
if (defined $opt{value}) { |
if (defined $opt{value}) { |
132 |
$out->html (' '); |
$out->html (' '); |
133 |
$out->code ($opt{value}); |
$out->code ($opt{value}); |
134 |
|
$has_location = 1; |
135 |
|
} |
136 |
|
|
137 |
|
unless ($has_location) { |
138 |
|
if (defined $opt{input}) { |
139 |
|
if (defined $opt{input}->{container_node}) { |
140 |
|
my $original_input = $out->input; |
141 |
|
$out->input ($opt{input}->{parent_input}); |
142 |
|
$out->node_link ($opt{input}->{container_node}); |
143 |
|
$out->input ($original_input); |
144 |
|
$has_location = 1; |
145 |
|
} elsif (defined $opt{input}->{request_uri}) { |
146 |
|
$out->url ($opt{input}->{request_uri}); |
147 |
|
$has_location = 1; |
148 |
|
} elsif (defined $opt{input}->{uri}) { |
149 |
|
$out->url ($opt{input}->{uri}); |
150 |
|
$has_location = 1; |
151 |
|
} |
152 |
|
} |
153 |
|
|
154 |
|
unless ($has_location) { |
155 |
|
$out->text ('No location information available'); |
156 |
|
} |
157 |
} |
} |
158 |
|
|
159 |
$out->start_tag ('dd', class => $class); |
$out->start_tag ('dd', class => $class); |
293 |
$out->end_section; |
$out->end_section; |
294 |
} # generate_result_section |
} # generate_result_section |
295 |
|
|
|
sub _get_error_label ($$) { |
|
|
my $self = shift; |
|
|
my ($input, $err) = @_; |
|
|
|
|
|
|
|
|
} # get_error_label |
|
|
|
|
296 |
sub get_error_level_label ($) { |
sub get_error_level_label ($) { |
297 |
my $self = shift; |
my $self = shift; |
298 |
my $err = shift; |
my $err = shift; |
322 |
return $r; |
return $r; |
323 |
} # get_error_level_label |
} # get_error_level_label |
324 |
|
|
|
sub get_node_path ($) { |
|
|
my $self = shift; |
|
|
my $node = shift; |
|
|
my @r; |
|
|
while (defined $node) { |
|
|
my $rs; |
|
|
if ($node->node_type == 1) { |
|
|
$rs = $node->node_name; |
|
|
$node = $node->parent_node; |
|
|
} elsif ($node->node_type == 2) { |
|
|
$rs = '@' . $node->node_name; |
|
|
$node = $node->owner_element; |
|
|
} elsif ($node->node_type == 3) { |
|
|
$rs = '"' . $node->data . '"'; |
|
|
$node = $node->parent_node; |
|
|
} elsif ($node->node_type == 9) { |
|
|
@r = ('') unless @r; |
|
|
$rs = ''; |
|
|
$node = $node->parent_node; |
|
|
} else { |
|
|
$rs = '#' . $node->node_type; |
|
|
$node = $node->parent_node; |
|
|
} |
|
|
unshift @r, $rs; |
|
|
} |
|
|
return join '/', @r; |
|
|
} # get_node_path |
|
|
|
|
|
use Scalar::Util qw/refaddr/; |
|
|
|
|
|
sub get_node_link ($$) { |
|
|
my $self = shift; |
|
|
return qq[<a href="#$_[0]->{id_prefix}node-@{[refaddr $_[1]]}">] . |
|
|
($self->get_node_path ($_[1])) . qq[</a>]; |
|
|
## BUG: ^ must be escaped |
|
|
} # get_node_link |
|
|
|
|
325 |
1; |
1; |