Inserts the specified node immediately before the specified reference node.
[Visual Basic] Overridable Public Function InsertBefore( _ ByVal newChild As XmlNode, _ ByVal refChild As XmlNode _ ) As XmlNode [C#] public virtual XmlNode InsertBefore( XmlNode newChild, XmlNode refChild ); [C++] public: virtual XmlNode* InsertBefore( XmlNode* newChild, XmlNode* refChild ); [JScript] public function InsertBefore( newChild : XmlNode, refChild : XmlNode ) : XmlNode;
Exception Type | Condition |
---|---|
HIERARCHY_REQUEST_ERR | This node is of a type that does not allow children of the type of the newChild node. Or the node to insert is one of this node's ancestors. |
WRONG_DOCUMENT_ERR | The newChild was created from a different document than the one that created this node. |
NO_MODIFICATION_ALLOWED_ERR | This node is read-only. |
NOT_FOUND_ERR | The refChild is not a child of this node. |
If refChild is null, insert newChild at the end of the list of children. If newChild is a XmlDocumentFragment object, all of its children are inserted, in the same order, before refChild. If the newChild is already in the tree, it is first removed.