validator/httpd/cgi-bin check,1.374,1.375

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

Modified Files:
	check 
Log Message:
Fix and re-enable "Other Namespaces".  The UI still needs some tweaking...

Index: check
===================================================================
RCS file: /sources/public/validator/httpd/cgi-bin/check,v
retrieving revision 1.374
retrieving revision 1.375
diff -u -d -r1.374 -r1.375
--- check	15 Jan 2005 15:21:24 -0000	1.374
+++ check	15 Jan 2005 16:14:05 -0000	1.375
@@ -288,9 +288,9 @@
 
 #
 # Listrefs.
-$File->{Lines}              = []; # Line numbers for encoding errors.
-$File->{Warnings}           = []; # Warnings...
-$File->{'Other Namespaces'} = []; # Other (non-root) Namespaces.
+$File->{Lines}      = []; # Line numbers for encoding errors.
+$File->{Warnings}   = []; # Warnings...
+$File->{Namespaces} = []; # Other (non-root) Namespaces.
 
 
 ###############################################################################
@@ -775,10 +775,16 @@
     $elements_found++ if /^\(/;
 
     if (/^Axmlns() \w+ (.*)/ or /^Axmlns:([^ ]+) \w+ (.*)/) {
-      if (not $File->{Namespace} and $elements_found == 0 and $1 eq "") {
-        $File->{Namespace} = $2;
+      if (not $File->{Namespace}) {
+        if ($elements_found == 0 and $1 eq "") {
+          $File->{Namespace} = $2;
+        } else {
+          # @@@ should not happen
+          push(@{$File->{Namespaces}}, $2);
+        }
+      } else {
+        push(@{$File->{Namespaces}}, $2) if ($2 ne $File->{Namespace});
       }
-      $File->{Namespaces}->{$2}++;
     }
 
     next if / IMPLIED$/;
@@ -965,8 +971,8 @@
   #
   # Namespaces...
   $T->param(file_namespace  => $File->{Namespace});
-#  $T->param(file_namespaces => $File->{Namespaces})
-#    if $File->{Namespaces};
+  my @nss                   =  map({uri => $_}, @{$File->{Namespaces}});
+  $T->param(file_namespaces => \@nss) if @nss;
 }
 
 #

Received on Saturday, 15 January 2005 16:14:08 UTC