XNamespace.NamespaceName プロパティ

定義

この名前空間の Uri (Uniform Resource Identifier) を取得します。

public:
 property System::String ^ NamespaceName { System::String ^ get(); };
public string NamespaceName { get; }
member this.NamespaceName : string
Public ReadOnly Property NamespaceName As String

プロパティ値

名前空間の URI を含む String

次の例は、このプロパティの使用方法を示しています。

string markup =
@"<aw:Root
    xmlns:aw='http://www.adventure-works.com'/>";
XElement root = XElement.Parse(markup);
Console.WriteLine(root.Name.Namespace.NamespaceName);
Imports <xmlns:aw="http://www.adventure-works.com">

Module Module1
    Sub Main()
        Dim aw As XNamespace = GetXmlNamespace(aw)
        Dim root As XElement = <aw:Root/>
        Console.WriteLine(root.Name.Namespace.NamespaceName)
    End Sub
End Module

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

http://www.adventure-works.com

適用対象

こちらもご覧ください