W3C home > Mailing lists > Public > www-validator-cvs@w3.org > May 2005

validator/httpd/cgi-bin check,1.416,1.417

From: Olivier Thereaux via cvs-syncmail <cvsmail@w3.org>
Date: Mon, 09 May 2005 08:55:33 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1DV433-0006JN-5p@lionel-hutz.w3.org>

Update of /sources/public/validator/httpd/cgi-bin
In directory hutz:/tmp/cvs-serv24157

Modified Files:
	check 
Log Message:
uniq'ing the list of non-root namespaces before passing it to results template 



Index: check
===================================================================
RCS file: /sources/public/validator/httpd/cgi-bin/check,v
retrieving revision 1.416
retrieving revision 1.417
diff -u -d -r1.416 -r1.417
--- check	9 May 2005 05:51:33 -0000	1.416
+++ check	9 May 2005 08:55:31 -0000	1.417
@@ -935,6 +935,14 @@
   #
   # Namespaces...
   $T->param(file_namespace  => $File->{Namespace});
+  my %seen_ns = ();
+  my @bulk_ns =  @{$File->{Namespaces}};
+  $File->{Namespaces} = []; # reinitialize the list of non-root namespaces
+  my  $single_namespace;
+  # ... and then get a uniq version of it
+  foreach $single_namespace (@bulk_ns) {
+     push(@{$File->{Namespaces}}, $single_namespace) unless $seen_ns{$single_namespace}++;
+  }
   my @nss                   =  map({uri => $_}, @{$File->{Namespaces}});
   $T->param(file_namespaces => \@nss) if @nss;
   
Received on Monday, 9 May 2005 08:55:46 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:02:10 UTC