다음을 통해 공유


XProcessingInstruction.Data 속성

정의

이 처리 명령의 문자열 값을 가져오거나 설정합니다.

public:
 property System::String ^ Data { System::String ^ get(); void set(System::String ^ value); };
public string Data { get; set; }
member this.Data : string with get, set
Public Property Data As String

속성 값

이 처리 명령의 문자열 값입니다.

예외

문자열 value 은 .입니다 null.

예제

다음 예제에서는 속성을 사용 하 여 Data 처리 명령의 문자열 값을 검색 합니다.

XProcessingInstruction pi =
    new XProcessingInstruction("xml-stylesheet", "type='text/xsl' href='hello.xsl'");
Console.WriteLine(pi.Data);
pi.Data = "type='text/xsl' href='xform.xsl'";
Console.WriteLine(pi.Data);
Dim pi As XProcessingInstruction = <?xml-stylesheet type='text/xsl' href='hello.xsl'?>
Console.WriteLine(pi.Data)
pi.Data = "type='text/xsl' href='xform.xsl'"
Console.WriteLine(pi.Data)

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

type='text/xsl' href='hello.xsl'
type='text/xsl' href='xform.xsl'

설명

이 속성을 사용하여 XML 트리를 수정할 수 있습니다. 이 속성을 사용하면 이벤트가 발생합니다.

적용 대상

추가 정보