XmlAttribute.OwnerDocument 속성
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
이 노드가 속한 XmlDocument를 가져옵니다.
public:
virtual property System::Xml::XmlDocument ^ OwnerDocument { System::Xml::XmlDocument ^ get(); };
public override System.Xml.XmlDocument OwnerDocument { get; }
member this.OwnerDocument : System.Xml.XmlDocument
Public Overrides ReadOnly Property OwnerDocument As XmlDocument
속성 값
이 노드가 속하는 XML 문서입니다.
예제
다음 예제에서는 특성을 만들고 해당 OwnerDocument
특성을 표시합니다.
#using <System.Xml.dll>
using namespace System;
using namespace System::IO;
using namespace System::Xml;
int main()
{
XmlDocument^ doc = gcnew XmlDocument;
doc->LoadXml( "<book><title>Pride And Prejudice</title></book>" );
//Create an attribute.
XmlAttribute^ attr;
attr = doc->CreateAttribute( "bk", "genre", "urn:samples" );
attr->Value = "novel";
//Display the attribute's owner document. Note
//that although the attribute has not been inserted
//into the document, it still has an owner document.
Console::WriteLine( attr->OwnerDocument->OuterXml );
}
using System;
using System.IO;
using System.Xml;
public class Sample
{
public static void Main(){
XmlDocument doc = new XmlDocument();
doc.LoadXml("<book>" +
"<title>Pride And Prejudice</title>" +
"</book>");
//Create an attribute.
XmlAttribute attr;
attr = doc.CreateAttribute("bk","genre","urn:samples");
attr.Value = "novel";
//Display the attribute's owner document. Note
//that although the attribute has not been inserted
//into the document, it still has an owner document.
Console.WriteLine(attr.OwnerDocument.OuterXml);
}
}
Imports System.IO
Imports System.Xml
public class Sample
public shared sub Main()
Dim doc as XmlDocument = new XmlDocument()
doc.LoadXml("<book>" & _
"<title>Pride And Prejudice</title>" & _
"</book>")
'Create an attribute.
Dim attr as XmlAttribute
attr = doc.CreateAttribute("bk","genre","urn:samples")
attr.Value = "novel"
'Display the attribute's owner document. Note
'that although the attribute has not been inserted
'into the document, it still has an owner document.
Console.WriteLine(attr.OwnerDocument.OuterXml)
end sub
end class