Author: atsushi
Date: 2005-03-07 09:39:59 -0500 (Mon, 07 Mar 2005)
New Revision: 41523

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

        * GenericOutputter.cs : compute attribute prefix only when actual
          emission. Fixed some cases that namespace output was missing.



Modified: trunk/mcs/class/System.XML/Mono.Xml.Xsl/ChangeLog
===================================================================
--- trunk/mcs/class/System.XML/Mono.Xml.Xsl/ChangeLog   2005-03-07 14:00:43 UTC 
(rev 41522)
+++ trunk/mcs/class/System.XML/Mono.Xml.Xsl/ChangeLog   2005-03-07 14:39:59 UTC 
(rev 41523)
@@ -1,5 +1,10 @@
 2005-03-07  Atsushi Enomoto  <[EMAIL PROTECTED]>
 
+       * GenericOutputter.cs : compute attribute prefix only when actual
+         emission. Fixed some cases that namespace output was missing.
+
+2005-03-07  Atsushi Enomoto  <[EMAIL PROTECTED]>
+
        * GenericOutputter.cs : no need to use two collections to store
          pending attributes. Just use ordered ListDictionary.
          newNamespace.Add(int) causes extraneous boxing.

Modified: trunk/mcs/class/System.XML/Mono.Xml.Xsl/GenericOutputter.cs
===================================================================
--- trunk/mcs/class/System.XML/Mono.Xml.Xsl/GenericOutputter.cs 2005-03-07 
14:00:43 UTC (rev 41522)
+++ trunk/mcs/class/System.XML/Mono.Xml.Xsl/GenericOutputter.cs 2005-03-07 
14:39:59 UTC (rev 41523)
@@ -188,9 +188,16 @@
                                for (int i = 0; i < pendingAttributesPos; i++) 
                                {
                                        Attribute attr = pendingAttributes [i];
-                                       string prefix = _nsManager.LookupPrefix 
(attr.Namespace, false);
+                                       string prefix = attr.Prefix;
+                                       string existing = 
_nsManager.LookupPrefix (attr.Namespace, false);
+                                       if (prefix.Length == 0 && 
attr.Namespace.Length > 0)
+                                               prefix = existing;
                                        if (prefix == null) {
-                                               prefix = attr.Prefix;
+                                               prefix = "xp_" + _xpCount++;
+                                       }
+                                       if (existing != prefix && 
attr.Namespace.Length > 0) {
+                                               newNamespaces.Add (prefix);
+                                               _currentNamespaceDecls [prefix] 
= attr.Namespace;
                                                _nsManager.AddNamespace 
(prefix, attr.Namespace);
                                        }
                                        
@@ -267,10 +274,6 @@
 
                public override void WriteAttributeString (string prefix, 
string localName, string nsURI, string value)
                {
-                       if (prefix == String.Empty && nsURI != String.Empty ||
-                               prefix == "xml" && nsURI != 
XmlNamespaceManager.XmlnsXml)
-                               prefix = "xp_" + _xpCount++;
-
                        //Put attribute to pending attributes collection, 
replacing namesake one
                        for (int i = 0; i < pendingAttributesPos; i++) {
                                Attribute attr = pendingAttributes [i];

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

Reply via email to