NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

XmlNavigator.Insert (TreePosition, Object, Type)

Inserts a copy of the node or nodes represented by "obj" into the specified position in this tree relative to the current position and moves the navigator to point at the root of the newly inserted nodes.

[Visual Basic]
Overloads MustOverride Public Sub Insert( _
   ByVal p As TreePosition, _
   ByVal obj As Object, _
   ByVal type As Type _
)
[C#]
public abstract void Insert(
   TreePosition p,
   object obj,
   Type type
);
[C++]
public: virtual void Insert(
   TreePosition p,
   Object* obj,
   Type* type
) = 0;
[JScript]
public abstract function Insert(
   p : TreePosition,
   obj : Object,
   type : Type
);

Parameters

p
The relative position of the new node. The position "None" means the new node is not inserted into the tree- but instead is left dangling with no parent. This is the only valid way to create DocumentFragment nodes.
obj
[To be supplied.]
type
The type of object. Optional. This parameter is only used to specify which interface to use if the object implements multiple interfaces. If type is null, the "instanceof" operator is used to determine the type.

A type of XmlNavigator copies the entire subtree pointed at by the other XmlNavigator object. The other XmlNavigator will not be moved.

Exceptions

Exception Type Condition
ArgumentException The object specifies a node with an XmlNodeType that can not be inserted at position p. For example, if the position specified is "Parent" then the NodeType of the new node cannot be Attribute, CDATA or Text or Comment.

The specified XmlNodeType requires a name and no name was provided.

The type argument is not one of the above.

Remarks

Inserting a subtree into the Parent position results in the current node becoming the first child of the new parent.

See Also

XmlNavigator Class | XmlNavigator Members | System.NewXml Namespace | XmlNavigator.Insert Overload List