XmlNode.OwnerDocument Property


Gets the XmlDocument to which this node belongs.

 virtual property System::Xml::XmlDocument ^ OwnerDocument { System::Xml::XmlDocument ^ get(); };
public virtual System.Xml.XmlDocument OwnerDocument { get; }
member this.OwnerDocument : System.Xml.XmlDocument
Public Overridable ReadOnly Property OwnerDocument As XmlDocument

Property Value

The XmlDocument to which this node belongs.

If the node is an XmlDocument (NodeType equals XmlNodeType.Document), this property returns null.


See OwnerDocument (in the XmlElement class) for an example using this property.


When adding nodes to the current node, use the XmlDocument returned by the OwnerDocument property to create the node.

Applies to