From f8d7740c32cf3164af6d9ab0cd218c77d25a86fc Mon Sep 17 00:00:00 2001
From: Alberto Massari <amassari@apache.org>
Date: Fri, 7 Jan 2005 08:33:15 +0000
Subject: [PATCH] scanReset() should always clear the maps used to detect
 duplicate attributes

git-svn-id: https://svn.apache.org/repos/asf/xerces/c/trunk@176276 13f79535-47bb-0310-9956-ffa450edef68
---
 src/xercesc/internal/DGXMLScanner.cpp  | 2 +-
 src/xercesc/internal/IGXMLScanner2.cpp | 4 ++--
 src/xercesc/internal/SGXMLScanner.cpp  | 3 +--
 src/xercesc/internal/XSAXMLScanner.cpp | 2 +-
 4 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/xercesc/internal/DGXMLScanner.cpp b/src/xercesc/internal/DGXMLScanner.cpp
index 172fcbd3c..57663cb5e 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 e796e3fac..7a22a05cb 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 d504746cf..f9730b862 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 6cbb3e4b8..1730cf10c 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();
 }
 
 
-- 
GitLab