Udostępnij za pośrednictwem


XProcessingInstruction.Data Właściwość

Definicja

Pobiera lub ustawia wartość ciągu tej instrukcji przetwarzania.

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

Wartość właściwości

Wartość ciągu tej instrukcji przetwarzania.

Wyjątki

Ciąg value to null.

Przykłady

W poniższym przykładzie użyto Data właściwości , aby pobrać wartość ciągu instrukcji przetwarzania.

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)

Ten przykład generuje następujące wyniki:

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

Uwagi

Za pomocą tej właściwości można zmodyfikować drzewo XML. Ta właściwość spowoduje wystąpienie zdarzeń.

Dotyczy

Zobacz też