XNamespace.NamespaceName Propriété

Définition

Obtient l’URI (Uniform Resource Identifier) de cet espace de noms.

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

Valeur de propriété

Qui String contient l’URI de l’espace de noms.

Exemples

L’exemple suivant montre comment utiliser cette propriété :

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

Cet exemple produit la sortie suivante :

http://www.adventure-works.com

S’applique à

Voir aussi