次の方法で共有


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

プロパティ値

この処理命令の文字列値。

例外

文字列 valuenull

次の例では、 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 ツリーを変更できます。 このプロパティを使用すると、イベントが発生します。

適用対象

こちらもご覧ください