InsertBefore()

XmlNode::InsertBefore(SharedPtr<XmlNode>, SharedPtr<XmlNode>) method

Inserts the specified node immediately before the specified reference node.

virtual SharedPtr<XmlNode> System::Xml::XmlNode::InsertBefore(SharedPtr<XmlNode> newChild, SharedPtr<XmlNode> refChild)

Arguments

ParameterTypeDescription
newChildSharedPtr<XmlNode>The node to insert.
refChildSharedPtr<XmlNode>The reference node. newChild is placed before this node.

Return Value

The node being inserted.

Exceptions

ExceptionDescription
InvalidOperationExceptionThe current node is of a type that does not allow child nodes of the type of the newChild node. The newChild is an ancestor of this node.
ArgumentExceptionThe newChild was created from a different document than the one that created this node. The refChild is not a child of this node. This node is read-only.

See Also