From 9668d23015c90b12de947360bf13fc659b3c6190 Mon Sep 17 00:00:00 2001
From: Gareth Reakes <gareth@apache.org>
Date: Wed, 14 May 2003 16:20:13 +0000
Subject: [PATCH] Fix to problem with multiple default namespace attributes
 being serialized. Patch by Alberto Massari.

git-svn-id: https://svn.apache.org/repos/asf/xerces/c/trunk@174961 13f79535-47bb-0310-9956-ffa450edef68
---
 src/xercesc/dom/impl/DOMWriterImpl.cpp | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/xercesc/dom/impl/DOMWriterImpl.cpp b/src/xercesc/dom/impl/DOMWriterImpl.cpp
index 2dfaf82a6..89a9d8ab9 100644
--- a/src/xercesc/dom/impl/DOMWriterImpl.cpp
+++ b/src/xercesc/dom/impl/DOMWriterImpl.cpp
@@ -57,6 +57,9 @@
 /*
  * $Id$
  * $Log$
+ * Revision 1.36  2003/05/14 16:20:13  gareth
+ * Fix to problem with multiple default namespace attributes being serialized. Patch by Alberto Massari.
+ *
  * Revision 1.35  2003/05/12 16:08:11  gareth
  * fix to #18832. Corrected serilization with regards to namespace nodes. Patch by Alby Massari.
  *
@@ -1001,8 +1004,11 @@ void DOMWriterImpl::processNode(const DOMNode* const nodeToWrite, int level)
                     {
                         if(XMLString::equals(ns, s_xmlnsURI)) 
                         {
-                            if(namespaceMap->containsKey((void*)attribute->getLocalName()))
-                                continue;
+			                const XMLCh* nsPrefix = attribute->getLocalName();
+                            if(XMLString::equals(attribute->getNodeName(),s_xmlns))
+								nsPrefix = XMLUni::fgZeroLenString;
+							if(namespaceMap->containsKey((void*)nsPrefix))
+								continue;
                             namespaceMap->put((void*)attribute->getLocalName(),(XMLCh*)attribute->getNodeValue());
                         }
                         else if(!XMLString::equals(ns, s_xmlURI)) 
-- 
GitLab