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.
Assembly: System.Xml.Linq (in System.Xml.Linq.dll)
Parameters
- localName
- Type: System.String
A String that contains a local name.
Return Value
Type: System.Xml.Linq.XNameAn 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()
Show: