XmlNode.Item[] 속성
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
지정된 자식 요소를 가져옵니다.
오버로드
| Name | Description |
|---|---|
| Item[String] |
지정된 Name자식 요소가 있는 첫 번째 자식 요소를 가져옵니다. |
| Item[String, String] |
지정 LocalName 한 자식 요소와 NamespaceURI.를 사용하여 첫 번째 자식 요소를 가져옵니다. |
Item[String]
- Source:
- XmlNode.cs
- Source:
- XmlNode.cs
- Source:
- XmlNode.cs
- Source:
- XmlNode.cs
- Source:
- XmlNode.cs
지정된 Name자식 요소가 있는 첫 번째 자식 요소를 가져옵니다.
public:
virtual property System::Xml::XmlElement ^ default[System::String ^] { System::Xml::XmlElement ^ get(System::String ^ name); };
public virtual System.Xml.XmlElement this[string name] { get; }
public virtual System.Xml.XmlElement? this[string name] { get; }
member this.Item(string) : System.Xml.XmlElement
Default Public Overridable ReadOnly Property Item(name As String) As XmlElement
매개 변수
- name
- String
검색할 요소의 정규화된 이름입니다.
속성 값
지정한 이름과 일치하는 첫 번째 XmlElement 이름입니다. 일치하는 항목이 없으면 null 참조(Visual Basic Nothing)를 반환합니다.
예제
다음 예제에서는 제목 요소를 표시합니다.
using System;
using System.IO;
using System.Xml;
public class Sample {
public static void Main() {
XmlDocument doc = new XmlDocument();
doc.LoadXml("<book ISBN='1-861001-57-5'>" +
"<title>Pride And Prejudice</title>" +
"<price>19.95</price>" +
"</book>");
XmlNode root = doc.FirstChild;
Console.WriteLine("Display the title element...");
Console.WriteLine(root["title"].OuterXml);
}
}
Option Explicit
Option Strict
Imports System.IO
Imports System.Xml
Public Class Sample
Public Shared Sub Main()
Dim doc As New XmlDocument()
doc.LoadXml("<book ISBN='1-861001-57-5'>" & _
"<title>Pride And Prejudice</title>" & _
"<price>19.95</price>" & _
"</book>")
Dim root As XmlNode = doc.FirstChild
Console.WriteLine("Display the title element...")
Console.WriteLine(root("title").OuterXml)
End Sub
End Class
설명
이 속성은 DOM(문서 개체 모델)에 대한 Microsoft 확장입니다.
적용 대상
Item[String, String]
- Source:
- XmlNode.cs
- Source:
- XmlNode.cs
- Source:
- XmlNode.cs
- Source:
- XmlNode.cs
- Source:
- XmlNode.cs
지정 LocalName 한 자식 요소와 NamespaceURI.를 사용하여 첫 번째 자식 요소를 가져옵니다.
public:
virtual property System::Xml::XmlElement ^ default[System::String ^, System::String ^] { System::Xml::XmlElement ^ get(System::String ^ localname, System::String ^ ns); };
public virtual System.Xml.XmlElement this[string localname, string ns] { get; }
public virtual System.Xml.XmlElement? this[string localname, string ns] { get; }
member this.Item(string * string) : System.Xml.XmlElement
Default Public Overridable ReadOnly Property Item(localname As String, ns As String) As XmlElement
매개 변수
- localname
- String
요소의 로컬 이름입니다.
- ns
- String
요소의 네임스페이스 URI입니다.
속성 값
일치하는 XmlElement 첫 번째 localname 및 ns. 일치하는 항목이 없으면 null 참조(Visual Basic Nothing)를 반환합니다.
설명
이 속성은 DOM(문서 개체 모델)에 대한 Microsoft 확장입니다.