XmlNode.OwnerDocument 属性

定义

获取此节点所属的 XmlDocumentGets the XmlDocument to which this node belongs.

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

属性值

XmlDocument

该节点所属的 XmlDocumentThe XmlDocument to which this node belongs.

如果该节点是一个 XmlDocument(NodeType 等于 XmlNodeType.Document),则此属性返回 nullIf the node is an XmlDocument (NodeType equals XmlNodeType.Document), this property returns null.

示例

OwnerDocument有关使用此属性的示例,请参阅 XmlElement 类) 中的 (。See OwnerDocument (in the XmlElement class) for an example using this property.

注解

将节点添加到当前节点时,请使用 XmlDocument 属性返回的 OwnerDocument 来创建节点。When adding nodes to the current node, use the XmlDocument returned by the OwnerDocument property to create the node.

适用于