Author: atsushi
Date: 2005-03-08 04:20:03 -0500 (Tue, 08 Mar 2005)
New Revision: 41553

Modified:
   trunk/mcs/class/System.XML/Mono.Xml.Xsl/ChangeLog
   trunk/mcs/class/System.XML/Mono.Xml.Xsl/GenericOutputter.cs
Log:
2005-03-08  Atsushi Enomoto  <[EMAIL PROTECTED]>

        * GenericOutputter.cs : When WriteStartElement() requires to add
          new namespace declaration, _currentNamespaceDecls needs to be set.



Modified: trunk/mcs/class/System.XML/Mono.Xml.Xsl/ChangeLog
===================================================================
--- trunk/mcs/class/System.XML/Mono.Xml.Xsl/ChangeLog   2005-03-08 08:38:20 UTC 
(rev 41552)
+++ trunk/mcs/class/System.XML/Mono.Xml.Xsl/ChangeLog   2005-03-08 09:20:03 UTC 
(rev 41553)
@@ -1,5 +1,10 @@
 2005-03-08  Atsushi Enomoto  <[EMAIL PROTECTED]>
 
+       * GenericOutputter.cs : When WriteStartElement() requires to add
+         new namespace declaration, _currentNamespaceDecls needs to be set.
+
+2005-03-08  Atsushi Enomoto  <[EMAIL PROTECTED]>
+
        * GenericOutputter.cs : for duplicate attribute in an element, no need
          to keep previous prefix.
 

Modified: trunk/mcs/class/System.XML/Mono.Xml.Xsl/GenericOutputter.cs
===================================================================
--- trunk/mcs/class/System.XML/Mono.Xml.Xsl/GenericOutputter.cs 2005-03-08 
08:38:20 UTC (rev 41552)
+++ trunk/mcs/class/System.XML/Mono.Xml.Xsl/GenericOutputter.cs 2005-03-08 
09:20:03 UTC (rev 41553)
@@ -169,11 +169,7 @@
                private void CheckState ()
                {
                        if (_state == WriteState.Element) {
-                               //Push scope to allow to unwind namespaces 
scope back in WriteEndElement
-                               //Subject to optimization - avoid redundant 
push/pop by moving 
-                               //namespaces to WriteStartElement
                                //Emit pending attributes
-                               newNamespaces.Clear (); //remember indexes of 
new prefexes
                                _nsManager.PushScope ();
                                foreach (string prefix in 
_currentNamespaceDecls.Keys)
                                {
@@ -203,7 +199,7 @@
                                                        prefix = "xp_" + 
_xpCount++;
                                                if (existing != prefix) {
                                                        newNamespaces.Add 
(prefix);
-                                                       _currentNamespaceDecls 
[prefix] = attr.Namespace;
+                                                       
_currentNamespaceDecls.Add (prefix, attr.Namespace);
                                                        _nsManager.AddNamespace 
(prefix, attr.Namespace);
                                                }
                                        }
@@ -222,6 +218,7 @@
                                _currentNamespaceDecls.Clear ();
                                //Attributes flushed, state is Content now      
                        
                                _state = WriteState.Content;
+                               newNamespaces.Clear ();
                        }
                        _canProcessAttributes = false;
                }
@@ -251,7 +248,8 @@
                        Emitter.WriteStartElement (prefix, localName, nsURI);
                        _state = WriteState.Element;
                        if (_nsManager.LookupNamespace (prefix, false) != nsURI)
-                               _nsManager.AddNamespace (prefix, nsURI);
+//                             _nsManager.AddNamespace (prefix, nsURI);
+                               _currentNamespaceDecls [prefix] = nsURI;
                        pendingAttributesPos = 0;
                        _canProcessAttributes = true;
                }

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to