This documentation is archived and is not being maintained.

XmlNode.OwnerDocument Property

Gets the XmlDocument to which this node belongs.

[Visual Basic]
Public Overridable ReadOnly Property OwnerDocument As XmlDocument
public virtual XmlDocument OwnerDocument {get;}
public: __property virtual XmlDocument* get_OwnerDocument();
public function get OwnerDocument() : XmlDocument;

Property Value

The XmlDocument to which this node belongs.

If the node is an XmlDocument (NodeType equals XmlNodeType.Document), this property returns a null reference (Nothing in Visual Basic).


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


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


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

See Also

XmlNode Class | XmlNode Members | System.Xml Namespace