XName.NamespaceName プロパティ
定義
この XNamespace の XName の URI を返します。Returns the URI of the XNamespace for this XName.
public:
property System::String ^ NamespaceName { System::String ^ get(); };
public string NamespaceName { get; }
member this.NamespaceName : string
Public ReadOnly Property NamespaceName As String
プロパティ値
この XNamespace の XName の URI。The URI of the XNamespace for this XName.
例
この例では、名前空間に要素を作成し、要素の名前空間を出力します。This example creates an element in a namespace, and then prints the element's namespace.
XNamespace aw = "http://www.adventure-works.com";
XElement root = new XElement(aw + "Root");
Console.WriteLine(root.Name.NamespaceName);
Imports <xmlns="http://www.adventure-works.com">
Module Module1
Sub Main()
Dim root As XElement = <Root/>
Console.WriteLine(root.Name.NamespaceName)
End Sub
End Module
この例を実行すると、次の出力が生成されます。This example produces the following output:
http://www.adventure-works.com
注釈
これは、 XNameから名前空間名を取得するための便利なプロパティです。This is a convenience property to get the namespace name from an XName.