XDeclaration.Version プロパティ

定義

このドキュメントのバージョン プロパティを取得または設定します。

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

プロパティ値

このドキュメントのバージョン プロパティを含む String

次の例では、このプロパティを使用して、宣言の version プロパティを出力します。

XDeclaration xd = new XDeclaration("1.0", "utf-8", "yes");
Console.WriteLine(xd.Version);
Console.WriteLine(xd.Encoding);
Console.WriteLine(xd.Standalone);
Dim xd As XDeclaration = New XDeclaration("1.0", "utf-8", "yes")
Console.WriteLine(xd.Version)
Console.WriteLine(xd.Encoding)
Console.WriteLine(xd.Standalone)

この例を実行すると、次の出力が生成されます。

1.0
utf-8
yes

注釈

通常、値は "1.0" です。 この値は適用されません。

適用対象

こちらもご覧ください