XNamespace.NamespaceName Proprietà

Definizione

Ottiene l'URI (Uniform Resource Identifier) di questo spazio dei nomi.

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

Valore della proprietà

Oggetto String contenente l'URI dello spazio dei nomi.

Esempio

Nell'esempio seguente viene illustrato come utilizzare questa proprietà:

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

In questo esempio viene generato l'output seguente:

http://www.adventure-works.com

Si applica a

Vedi anche