NamespaceName Property
Collapse the table of content
Expand the table of content

XName.NamespaceName Property

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Returns the URI of the XNamespace for this XName.

Namespace:  System.Xml.Linq
Assembly:  System.Xml.Linq (in System.Xml.Linq.dll)

'Declaration
Public ReadOnly Property NamespaceName As String

Property Value

Type: System.String
The URI of the XNamespace for this XName.

This is a convenience property to get the namespace name from an XName.

This example creates an element in a namespace, and then prints the element's namespace.


'add the following line to the the Imports section:
'Imports <xmlns="http://www.adventure-works.com">
Dim output As New StringBuilder
Dim root As XElement = <Root/>
output.Append(root.Name.NamespaceName)
output.Append(Environment.NewLine)

OutputTextBlock.Text = output.ToString()


Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2017 Microsoft