Mono Class Library: System.Xml.XmlDocument Overview | Members

System.Xml.XmlDocument.ImportNode Method

Used to import an System.Xml.XmlNode which comes from another document instance. [Edit]

public virtual XmlNode ImportNode (XmlNode node, bool deep)

Parameters

node
An System.Xml.XmlNode to import. [Edit]
deep
a boolean value that indicates whether this method copies the descendants of the argument node. [Edit]

Returns

An System.Xml.XmlNode that is imported. [Edit]

Remarks

This method is used to "import" a node which resides another XmlDocument. XmlNode objects cannot be added if its XmlNode.OwnerDocument is different from this object. This method creates a "clone" of argument node as its own node that can be added to the tree of this document.

If deep is specified, then it recursively imports descendant nodes and appended to the corresponding parent node. Regardless of this parameter, attribute nodes are copied. They are not "children" of the owner node.

The returned node is "detached". It is not appended to the corresponding XmlNode.ParentNode of the argument node even if it exists.

[Edit]

Requirements

Namespace: System.Xml
Assembly: System.Xml (in System.Xml.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0