diff options
author | Atsushi Eno <atsushieno@gmail.com> | 2004-01-20 10:39:06 +0300 |
---|---|---|
committer | Atsushi Eno <atsushieno@gmail.com> | 2004-01-20 10:39:06 +0300 |
commit | 48199379da6ad0d0f4c7eec0a35533d771901081 (patch) | |
tree | cf579cecc9ba51484685a505e298967133c45116 /mcs/class/System.XML/System.Xml/XmlTextWriter.cs | |
parent | 64714a6bf5e755a84895b35422a2a0f0136b1550 (diff) |
2004-01-20 Atsushi Enomoto <atsushi@ximian.com>
* XmlNode.cs : When adding a node to child list, it should reject its
ancestors. Patch by Boris Kirzner.
* XmlNodeReader.cs : Related fix to the fix above. It should not move
to children of XmlEntityReference nodes.
* XmlTextWriter.cs : FixedWriteStartElement() not to write default
namespace when ns is null (while ns is "", it writes default ns).
* XmlElement.cs : Fixed WriteTo() to call WriteStartElement(localName)
when NamespaceURI is an empty string.
svn path=/trunk/mcs/; revision=22286
Diffstat (limited to 'mcs/class/System.XML/System.Xml/XmlTextWriter.cs')
-rw-r--r-- | mcs/class/System.XML/System.Xml/XmlTextWriter.cs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/mcs/class/System.XML/System.Xml/XmlTextWriter.cs b/mcs/class/System.XML/System.Xml/XmlTextWriter.cs index c1cdc2f133f..e172cfd4f1a 100644 --- a/mcs/class/System.XML/System.Xml/XmlTextWriter.cs +++ b/mcs/class/System.XML/System.Xml/XmlTextWriter.cs @@ -755,9 +755,7 @@ namespace System.Xml throw new ArgumentException ("Cannot use a prefix with an empty namespace."); // ignore non-namespaced node's prefix. - if (ns == null) - ns = String.Empty; - if (ns == String.Empty) + if (ns == null || ns == String.Empty) prefix = String.Empty; @@ -772,7 +770,7 @@ namespace System.Xml newAttributeNamespaces.Clear (); userWrittenNamespaces.Clear (); - if (prefix == null) + if (prefix == null && ns != null) prefix = namespaceManager.LookupPrefix (ns); if (prefix == null) prefix = String.Empty; |