Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
OwnerDocument Property

XmlNode.OwnerDocument Property

Gets the XmlDocument to which this node belongs.

Namespace:  System.Xml
Assembly:  System.Xml (in System.Xml.dll)

abstract OwnerDocument : XmlDocument with get 
override OwnerDocument : XmlDocument with get

Property Value

Type: System.Xml.XmlDocument
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.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

XNA Framework

Supported in: 3.0, 2.0, 1.0
Show:
© 2015 Microsoft