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 ($) { |
166 |
$out->start_tag ('dt'); |
$out->start_tag ('dt'); |
167 |
$out->url ($url); |
$out->url ($url); |
168 |
$out->start_tag ('dd'); |
$out->start_tag ('dd'); |
169 |
$out->link ('Check conformance of this document', |
$out->link_to_webhacc ('Check conformance of this document', url => $url); |
|
url => _get_cc_url ($url)); |
|
170 |
$out->html ('<dd>Found in: <ul>'); |
$out->html ('<dd>Found in: <ul>'); |
171 |
for my $entry (@{$urls->{$url}}) { |
for my $entry (@{$urls->{$url}}) { |
172 |
$out->html (qq[<li>] . $result->get_node_link ($input, $entry->{node})); |
$out->html (qq[<li>] . $result->get_node_link ($input, $entry->{node})); |
194 |
$out->end_section; |
$out->end_section; |
195 |
} # generate_url_section |
} # generate_url_section |
196 |
|
|
|
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 |
|
|
|
|
197 |
1; |
1; |