GetName Method
Collapse the table of content
Expand the table of content

XNamespace.GetName Method

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

Returns an XName object created from this XNamespace and the specified local name.

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

'Declaration
Public Function GetName ( _
	localName As String _
) As XName

Parameters

localName
Type: System.String
A String that contains a local name.

Return Value

Type: System.Xml.Linq.XName
An XName created from this XNamespace and the specified local name.

The returned XName object is guaranteed to be atomic (that is, it is the only one in the system for a specific expanded name).

The following example uses this property to retrieve an XName.


'add the following line to the the Imports section:
'Imports <xmlns="http://www.adventure-works.com">
Dim output As New StringBuilder
Dim aw As XNamespace = GetXmlNamespace(aw)
Dim name As XName = aw.GetName("Root")
output.Append(String.Format("{0}", name))
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