5 |
die "$0: No constructor is defined for " . ref $_[0]; |
die "$0: No constructor is defined for " . ref $_[0]; |
6 |
} # new |
} # new |
7 |
|
|
8 |
|
## NOTE: |
9 |
|
## Language ->input, ->output, ->result |
10 |
|
## Input |
11 |
|
## Output ->input |
12 |
|
## Result ->output |
13 |
|
|
14 |
sub input ($;$) { |
sub input ($;$) { |
15 |
if (@_ > 1) { |
if (@_ > 1) { |
16 |
if (defined $_[1]) { |
if (defined $_[1]) { |
60 |
} # onsubdoc |
} # onsubdoc |
61 |
|
|
62 |
sub generate_syntax_error_section ($) { |
sub generate_syntax_error_section ($) { |
63 |
die "$0: Syntactical checking for " . ref $_[0] . " is not supported"; |
die "$0: Syntactical checking for " . (ref $_[0]) . " is not supported"; |
64 |
} # generate_syntax_error_section |
} # generate_syntax_error_section |
65 |
|
|
66 |
sub generate_structure_dump_section ($) { |
sub generate_structure_dump_section ($) { |
135 |
$out->start_tag ('li', id => 'line-1'); |
$out->start_tag ('li', id => 'line-1'); |
136 |
} |
} |
137 |
$out->end_tag ('ol'); |
$out->end_tag ('ol'); |
138 |
$out->html (qq[<script> |
$out->add_source_to_parse_error_list ('parse-errors-list'); |
|
addSourceToParseErrorList ('@{[$input->id_prefix]}', 'parse-errors-list'); |
|
|
</script>]); |
|
139 |
$out->end_section |
$out->end_section |
140 |
} # generate_source_string_section |
} # generate_source_string_section |
141 |
|
|
164 |
$out->start_tag ('dt'); |
$out->start_tag ('dt'); |
165 |
$out->url ($url); |
$out->url ($url); |
166 |
$out->start_tag ('dd'); |
$out->start_tag ('dd'); |
167 |
$out->link ('Check conformance of this document', |
$out->link_to_webhacc ('Check conformance of this document', url => $url); |
|
url => _get_cc_url ($url)); |
|
168 |
$out->html ('<dd>Found in: <ul>'); |
$out->html ('<dd>Found in: <ul>'); |
169 |
for my $entry (@{$urls->{$url}}) { |
for my $entry (@{$urls->{$url}}) { |
170 |
$out->html (qq[<li>] . $result->get_node_link ($input, $entry->{node})); |
$out->start_tag ('li'); |
171 |
|
$out->node_link ($entry->{node}); |
172 |
if (keys %{$entry->{type} or {}}) { |
if (keys %{$entry->{type} or {}}) { |
173 |
$out->text (' ('); |
$out->text (' ('); |
174 |
$out->text (join ', ', map { |
$out->text (join ', ', map { |
193 |
$out->end_section; |
$out->end_section; |
194 |
} # generate_url_section |
} # generate_url_section |
195 |
|
|
|
sub _encode_url_component ($) { |
|
|
require Encode; |
|
|
my $s = Encode::encode ('utf8', shift); |
|
|
$s =~ s/([^0-9A-Za-z_.~-])/sprintf '%%%02X', ord $1/ge; |
|
|
return $s; |
|
|
} # _encode_url_component |
|
|
|
|
|
sub _get_cc_url ($) { |
|
|
return './?uri=' . _encode_url_component ($_[0]); |
|
|
} # _get_cc_url |
|
|
|
|
196 |
1; |
1; |