- From: Olivier Thereaux via cvs-syncmail <cvsmail@w3.org>
- Date: Fri, 18 Mar 2005 06:37:32 +0000
- To: www-validator-cvs@w3.org
Update of /sources/public/validator/misc In directory hutz:/tmp/cvs-serv27309/misc Modified Files: docs_errors.pl Log Message: error explanations doc - separating items with an explanation from items that do not Index: docs_errors.pl =================================================================== RCS file: /sources/public/validator/misc/docs_errors.pl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- docs_errors.pl 17 Mar 2005 06:30:13 -0000 1.1 +++ docs_errors.pl 18 Mar 2005 06:37:30 -0000 1.2 @@ -77,10 +77,11 @@ die_on_bad_params => FALSE, ); -$T->param(list_errors => &list_errors($RSRC)); +$T->param(list_errors => &list_errors_hasverbose($RSRC)); +$T->param(list_errors => &list_errors_noverbose($RSRC)); print $T->output; -sub list_errors{ +sub list_errors_hasverbose{ my $RSRC = shift; my $errors = []; my $error_id; @@ -90,12 +91,44 @@ my %single_error; if ($RSRC->{msg}->{$error_id}) { - my $original = $RSRC->{msg}->{$error_id}->{original}; - $original = &de_template_explanation($original); - $single_error{original} = $original; - $single_error{verbose} = $RSRC->{msg}->{$error_id}->{verbose}; - $single_error{id} = $error_id; - push @{$errors}, \%single_error; + my $verbose = $RSRC->{msg}->{$error_id}->{verbose}; + if ($verbose) + { + my $original = $RSRC->{msg}->{$error_id}->{original}; + $original = &de_template_explanation($original); + $single_error{original} = $original; + $single_error{id} = $error_id; + $single_error{verbose} = $RSRC->{msg}->{$error_id}->{verbose}; + push @{$errors}, \%single_error; + } + + } + } + print $errors; + return $errors; +} + +sub list_errors_noverbose{ + my $RSRC = shift; + my $errors = []; + my $error_id; + my $max_error_id=500; # where to stop + for ($error_id=0;$error_id<$max_error_id;$error_id++) + { + my %single_error; + if ($RSRC->{msg}->{$error_id}) + { + my $verbose = $RSRC->{msg}->{$error_id}->{verbose}; + if (! $verbose) + { + my $original = $RSRC->{msg}->{$error_id}->{original}; + $original = &de_template_explanation($original); + $single_error{original} = $original; + $single_error{id} = $error_id; + $single_error{verbose} = $RSRC->{msg}->{$error_id}->{verbose}; + push @{$errors}, \%single_error; + } + } } print $errors;
Received on Friday, 18 March 2005 06:37:33 UTC