diff --git a/src/xercesc/internal/DGXMLScanner.cpp b/src/xercesc/internal/DGXMLScanner.cpp
index 172fcbd3c250789edbad0013ab8b3d8f28bd2ad7..57663cb5ee81164f87957b85388cd858378d412d 100644
--- a/src/xercesc/internal/DGXMLScanner.cpp
+++ b/src/xercesc/internal/DGXMLScanner.cpp
@@ -2246,7 +2246,6 @@ void DGXMLScanner::scanReset(const InputSource& src)
     if(fUIntPoolRowTotal >= 32) 
     { // 8 KB tied up with validating attributes...
         fAttDefRegistry->removeAll();
-        fUndeclaredAttrRegistry->removeAll();
         recreateUIntPool();
     }
     else
@@ -2255,6 +2254,7 @@ void DGXMLScanner::scanReset(const InputSource& src)
         // though their buckets will still be tied up
         resetUIntPool();
     }
+    fUndeclaredAttrRegistry->removeAll();
 }
 
 
diff --git a/src/xercesc/internal/IGXMLScanner2.cpp b/src/xercesc/internal/IGXMLScanner2.cpp
index e796e3face623932efebe58b636ad84eb89a7c9a..7a22a05cb73941f268e9e4ea64521ad5217635ca 100644
--- a/src/xercesc/internal/IGXMLScanner2.cpp
+++ b/src/xercesc/internal/IGXMLScanner2.cpp
@@ -1251,8 +1251,6 @@ void IGXMLScanner::scanReset(const InputSource& src)
     if(fUIntPoolRowTotal >= 32) 
     { // 8 KB tied up with validating attributes...
         fAttDefRegistry->removeAll();
-        fUndeclaredAttrRegistry->removeAll();
-        fUndeclaredAttrRegistryNS->removeAll();
         recreateUIntPool();
     }
     else
@@ -1261,6 +1259,8 @@ void IGXMLScanner::scanReset(const InputSource& src)
         // though their buckets will still be tied up
         resetUIntPool();
     }
+    fUndeclaredAttrRegistry->removeAll();
+    fUndeclaredAttrRegistryNS->removeAll();
 }
 
 
diff --git a/src/xercesc/internal/SGXMLScanner.cpp b/src/xercesc/internal/SGXMLScanner.cpp
index d504746cf4a24c2df802193b015fc67f0adab340..f9730b862c23b43576abdd59fcf330196c179700 100644
--- a/src/xercesc/internal/SGXMLScanner.cpp
+++ b/src/xercesc/internal/SGXMLScanner.cpp
@@ -3123,7 +3123,6 @@ void SGXMLScanner::scanReset(const InputSource& src)
     if(fUIntPoolRowTotal >= 32) 
     { // 8 KB tied up with validating attributes...
         fAttDefRegistry->removeAll();
-        fUndeclaredAttrRegistryNS->removeAll();
         recreateUIntPool();
     }
     else
@@ -3132,7 +3131,7 @@ void SGXMLScanner::scanReset(const InputSource& src)
         // though their buckets will still be tied up
         resetUIntPool();
     }
-    
+    fUndeclaredAttrRegistryNS->removeAll();
 }
 
 
diff --git a/src/xercesc/internal/XSAXMLScanner.cpp b/src/xercesc/internal/XSAXMLScanner.cpp
index 6cbb3e4b84645ed95b11e0e170abea4681714d9b..1730cf10c0659c32ce5bf95c72deb8d6641c077d 100644
--- a/src/xercesc/internal/XSAXMLScanner.cpp
+++ b/src/xercesc/internal/XSAXMLScanner.cpp
@@ -582,7 +582,6 @@ void XSAXMLScanner::scanReset(const InputSource& src)
     if (fUIntPoolRowTotal >= 32) 
     { // 8 KB tied up with validating attributes...
         fAttDefRegistry->removeAll();
-        fUndeclaredAttrRegistryNS->removeAll();
         recreateUIntPool();
     }
     else
@@ -591,6 +590,7 @@ void XSAXMLScanner::scanReset(const InputSource& src)
         // though their buckets will still be tied up
         resetUIntPool();
     }
+    fUndeclaredAttrRegistryNS->removeAll();
 }