W3C home > Mailing lists > Public > public-dap-commits@w3.org > December 2009

2009/dap/ReSpec.js/js respec.js,1.64,1.65

From: Frederick Hirsch via cvs-syncmail <cvsmail@w3.org>
Date: Fri, 04 Dec 2009 18:02:00 +0000
To: public-dap-commits@w3.org
Message-Id: <E1NGcTg-0001lD-ME@lionel-hutz.w3.org>
Update of /sources/public/2009/dap/ReSpec.js/js
In directory hutz:/tmp/cvs-serv6715/d

Modified Files:
	respec.js 
Log Message:
 modified to be less verbose on bibl errors, listing each only once with count.

Index: respec.js
===================================================================
RCS file: /sources/public/2009/dap/ReSpec.js/js/respec.js,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -d -r1.64 -r1.65
--- respec.js	4 Dec 2009 13:55:01 -0000	1.64
+++ respec.js	4 Dec 2009 18:01:58 -0000	1.65
@@ -575,7 +575,8 @@
         document.normalize();
         
         // PRE-PROCESSING
-        var norms = {}, informs = {}, abbrMap = {}, acroMap = {};
+        var norms = {}, informs = {}, abbrMap = {}, acroMap = {}, badrefs = {};
+        var badrefcount = 0;
         var abbrs = document.querySelectorAll("abbr[title]");
         for (var i = 0; i < abbrs.length; i++) abbrMap[abbrs[i].textContent] = abbrs[i].getAttribute("title");
         var acros = document.querySelectorAll("acronym[title]");
@@ -629,7 +630,12 @@
                             sn.text("]", df);
                         }
                         else {
-                            error("Got token looking like a reference, not in biblio DB: " + ref);
+                            badrefcount++;
+                            if ( badrefs[ref] ) {
+                                badrefs[ref] = badrefs[ref] + 1 ;
+                            } else {
+                                badrefs[ref] =  1 ;
+                            }
                         }
                     }
                     // ABBR
@@ -651,6 +657,13 @@
         
         // POST-PROCESSING
         // bibref
+    if(badrefcount > 0) {
+        error("Got " + badrefcount + " tokens looking like a reference, not in biblio DB: ");
+        for (var item in badrefs) {
+            error("Bad ref" + item + ", count = " + badrefs[item]);
+        }
+    }
+
         var del = [];
         for (var k in informs) {
             if (norms[k]) del.push(k);
Received on Friday, 4 December 2009 18:02:09 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 4 December 2009 18:02:09 GMT