XDocument.NodeType 속성

정의

이 노드에 대한 노드 형식을 가져옵니다.

public:
 virtual property System::Xml::XmlNodeType NodeType { System::Xml::XmlNodeType get(); };
public override System.Xml.XmlNodeType NodeType { get; }
member this.NodeType : System.Xml.XmlNodeType
Public Overrides ReadOnly Property NodeType As XmlNodeType

속성 값

노드 형식입니다. XDocument 개체의 경우 이 값은 Document입니다.

예제

다음 예제에서는 이 속성의 사용을 보여 있습니다.

// Note that this property uses XmlNodeType, which is in the System.Xml namespace.
XDocument xmlTree = new XDocument(
    new XDeclaration("1.0", "utf-8", "yes"),
    new XElement("Root", "content")
);
Console.WriteLine(xmlTree.NodeType);
' Note that this property uses XmlNodeType, which is in the System.Xml namespace.
Dim xmlTree As XDocument = _
    <?xml version='1.0' encoding='utf-8' standalone='yes'?>
        <Root>content</Root>
Console.WriteLine("{0}", xmlTree.NodeType)

이 예제는 다음과 같은 출력을 생성합니다.

Document

설명

에서 XObject 파생되는 모든 클래스에는 속성이 포함되어 NodeType 있으므로 각 형식이 의 하위 클래스 XObject인 개체 컬렉션에서 작동하는 코드를 작성할 수 있습니다. 그러면 코드에서 컬렉션에 있는 각 개체의 노드 형식을 테스트할 수 있습니다.

적용 대상

추가 정보