2003-02-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
[mono.git] / mcs / class / System.XML / System.Xml / XmlProcessingInstruction.cs
index 9efe34f4815d1d88fe48174b97e0d72a7610ce76..089c18965422819567ec83fcb49339b26aea01fe 100644 (file)
@@ -8,6 +8,7 @@
 //
 
 using System;
+using System.Xml.XPath;
 
 namespace System.Xml
 {
@@ -18,9 +19,11 @@ namespace System.Xml
 
                #region Constructors
 
-               protected internal XmlProcessingInstruction (string target, string data, XmlDocument doc)
-                       : base(doc)
+               protected internal XmlProcessingInstruction (string target, string data, XmlDocument doc) : base(doc)
                {
+                       if (data == null)
+                               data = String.Empty;
+
                        this.target = target;
                        this.data = data;
                }
@@ -36,11 +39,10 @@ namespace System.Xml
                        set { data = value; }
                }
 
-               [MonoTODO]
                public override string InnerText
                {
-                       get { throw new NotImplementedException (); }
-                       set { throw new NotImplementedException (); }
+                       get { return Data; }
+                       set { data = value; }
                }
 
                public override string LocalName
@@ -57,6 +59,12 @@ namespace System.Xml
                {
                        get { return XmlNodeType.ProcessingInstruction; }
                }
+
+               internal override XPathNodeType XPathNodeType {
+                       get {
+                               return XPathNodeType.ProcessingInstruction;
+                       }
+               }
                
                public string Target
                {
@@ -83,16 +91,11 @@ namespace System.Xml
                        return new XmlProcessingInstruction (target, data, OwnerDocument);
                }
 
-               [MonoTODO]
-               public override void WriteContentTo (XmlWriter w)
-               {
-                       throw new NotImplementedException ();
-               }
+               public override void WriteContentTo (XmlWriter w) { }
 
-               [MonoTODO]
                public override void WriteTo (XmlWriter w)
                {
-                       throw new NotImplementedException ();
+                       w.WriteProcessingInstruction (target, data);
                }
 
                #endregion