Adds a new processing instruction node to the child list of this element.
[Visual Basic] Public Function AddPI( _ ByVal name As String, _ ByVal text As String _ ) As XmlPI [C#] public XmlPI AddPI( string name, string text ); [C++] public: XmlPI* AddPI( String* name, String* text ); [JScript] public function AddPI( name : String, text : String ) : XmlPI;
The newly created processing instruction node.
Exception Type | Condition |
---|---|
ArgumentException | If name does not start with a '?' character or if text contains the character sequence "?>". |
The name of the processing instruction must start with a '?' character. An exception is thrown if text contains the caracter sequence "?>" in any position (that sequence is reserved to indicate the end of a processing instruction).
XmlContainer Class | XmlContainer Members | System.Xml Namespace