XmlValidatingReader.GetAttribute 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
특성의 값을 가져옵니다.
오버로드
| Name | Description |
|---|---|
| GetAttribute(Int32) |
지정된 인덱스가 있는 특성의 값을 가져옵니다. |
| GetAttribute(String) |
지정된 이름을 가진 특성의 값을 가져옵니다. |
| GetAttribute(String, String) |
지정된 로컬 이름 및 네임스페이스 URI(Uniform Resource Identifier)가 있는 특성의 값을 가져옵니다. |
GetAttribute(Int32)
- Source:
- XmlValidatingReader.cs
- Source:
- XmlValidatingReader.cs
- Source:
- XmlValidatingReader.cs
- Source:
- XmlValidatingReader.cs
- Source:
- XmlValidatingReader.cs
지정된 인덱스가 있는 특성의 값을 가져옵니다.
public:
override System::String ^ GetAttribute(int i);
public override string GetAttribute(int i);
override this.GetAttribute : int -> string
Public Overrides Function GetAttribute (i As Integer) As String
매개 변수
- i
- Int32
특성의 인덱스입니다. 인덱스는 0부터 시작합니다. (첫 번째 특성에는 인덱스 0이 있습니다.)
반환
지정된 특성의 값입니다.
예외
i 매개 변수가 0보다 작거나 같거나 같습니다AttributeCount.
설명
이 메서드는 판독기를 이동하지 않습니다.
메모
클래스는 XmlValidatingReader .NET Framework 2.0에서 사용되지 않습니다. 클래스 및 Create 메서드를 사용하여 유효성 XmlReader 검사 인스턴스를 XmlReaderSettings 만들 수 있습니다. 자세한 내용은 XmlReader 참조 페이지의 설명 섹션을 참조하세요.
추가 정보
적용 대상
GetAttribute(String)
- Source:
- XmlValidatingReader.cs
- Source:
- XmlValidatingReader.cs
- Source:
- XmlValidatingReader.cs
- Source:
- XmlValidatingReader.cs
- Source:
- XmlValidatingReader.cs
지정된 이름을 가진 특성의 값을 가져옵니다.
public:
override System::String ^ GetAttribute(System::String ^ name);
public override string? GetAttribute(string name);
public override string GetAttribute(string name);
override this.GetAttribute : string -> string
Public Overrides Function GetAttribute (name As String) As String
매개 변수
- name
- String
특성의 정규화된 이름입니다.
반환
지정된 특성의 값입니다. 특성을 찾을 null 수 없으면 반환됩니다.
설명
메모
클래스는 XmlValidatingReader .NET Framework 2.0에서 사용되지 않습니다. 클래스 및 Create 메서드를 사용하여 유효성 XmlReader 검사 인스턴스를 XmlReaderSettings 만들 수 있습니다. 자세한 내용은 XmlReader 참조 페이지의 설명 섹션을 참조하세요.
이 메서드는 판독기를 이동하지 않습니다.
판독기를 노드에 배치하는 경우 이 메서드를 DocumentType 사용하여 PUBLIC 및 SYSTEM 리터럴을 가져올 수 있습니다. 예를 들면 다음과 같습니다. reader.GetAttribute("PUBLIC")
추가 정보
적용 대상
GetAttribute(String, String)
- Source:
- XmlValidatingReader.cs
- Source:
- XmlValidatingReader.cs
- Source:
- XmlValidatingReader.cs
- Source:
- XmlValidatingReader.cs
- Source:
- XmlValidatingReader.cs
지정된 로컬 이름 및 네임스페이스 URI(Uniform Resource Identifier)가 있는 특성의 값을 가져옵니다.
public:
override System::String ^ GetAttribute(System::String ^ localName, System::String ^ namespaceURI);
public override string? GetAttribute(string localName, string? namespaceURI);
public override string GetAttribute(string localName, string namespaceURI);
override this.GetAttribute : string * string -> string
Public Overrides Function GetAttribute (localName As String, namespaceURI As String) As String
매개 변수
- localName
- String
특성의 로컬 이름입니다.
- namespaceURI
- String
특성의 네임스페이스 URI입니다.
반환
지정된 특성의 값입니다. 특성을 찾을 null 수 없으면 반환됩니다. 이 메서드는 판독기를 이동하지 않습니다.
설명
메모
클래스는 XmlValidatingReader .NET Framework 2.0에서 사용되지 않습니다. 클래스 및 Create 메서드를 사용하여 유효성 XmlReader 검사 인스턴스를 XmlReaderSettings 만들 수 있습니다. 자세한 내용은 XmlReader 참조 페이지의 설명 섹션을 참조하세요.
다음 XML에는 특정 네임스페이스의 특성이 포함되어 있습니다.
<test xmlns:dt="urn:datatypes" dt:type="int"/>
하나의 인수(접두사 및 로컬 이름) 또는 두 개의 인수(로컬 이름 및 네임스페이스 URI)를 사용하여 특성을 조회 dt:type 할 수 있습니다.
String dt = reader.GetAttribute("dt:type");
String dt2 = reader.GetAttribute("type","urn:datatypes");
특성을 조회 xmlns:dt 하려면 다음 인수 중 하나를 사용합니다.
String dt3 = reader.GetAttribute("xmlns:dt");
String dt4 = reader.GetAttribute("dt",http://www.w3.org/2000/xmlns/);
속성을 사용하여 Prefix 이 정보를 가져올 수도 있습니다.