2002-09-15 Duncan Mak <duncan@ximian.com>
[mono.git] / mcs / class / System.XML / System.Xml / XmlDeclaration.cs
index e1dcf421527bbd175edfae34f7e5ba3402858a5c..8f1974e4d9aef7fd34764e2427267795bcf1f5fd 100644 (file)
@@ -89,16 +89,13 @@ namespace System.Xml
                        return new XmlDeclaration (Version, Encoding, standalone, OwnerDocument);
                }
 
-               public override void WriteContentTo (XmlWriter w)
-               {
-                       // Nothing to do - no children.
-               }
+               public override void WriteContentTo (XmlWriter w) {}
 
-               [MonoTODO]
                public override void WriteTo (XmlWriter w)
                {
-                       if ((Standalone == String.Empty) || (Encoding == String.Empty))
-                               return;
+                       // This doesn't seem to match up very well with w.WriteStartDocument()
+                       // so writing out custom here.
+                       w.WriteRaw (String.Format ("<?xml {0}?>", Value));
                }
 
                void ParseInput (string input)