New tests.
[mono.git] / mcs / class / System.XML / System.Xml / XmlTextWriter2.cs
index 3afd3bedf79476af23f839fd9d6a780417bc74c0..a47d0edc80b5fb13c25696cb5891d83240d5f2d2 100644 (file)
@@ -841,7 +841,7 @@ namespace Mono.Xml
                                if (prefix == "xml")
                                        namespaceUri = XmlNamespace;
                                // infer namespace URI.
-                               else if ((object) namespaceUri == null) {
+                               else if ((object) namespaceUri == null || (v2 && namespaceUri.Length == 0)) {
                                        if (isNSDecl)
                                                namespaceUri = XmlnsNamespace;
                                        else
@@ -1102,7 +1102,7 @@ namespace Mono.Xml
 
                public override void WriteString (string text)
                {
-                       if (text == null || text.Length == 0)
+                       if (text == null || (text.Length == 0 && !v2))
                                return; // do nothing, including state transition.
                        ShiftStateContent ("Text", true);