XNamespace.Addition Operator
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Combines an XNamespace object with a local name to create an XName.
Assembly: System.Xml.Linq (in System.Xml.Linq.dll)
Parameters
- ns
- Type: System.Xml.Linq.XNamespace
An XNamespace that contains the namespace.
- localName
- Type: System.String
A String that contains the local name.
This operator enables the common idiom of combining a namespace and a local name in the construction of an element or attribute. This idiom provides some of the benefits of having namespace prefixes, in that you can refer to a namespace using a variable that is short. This eliminates syntactic noise in the code that creates XML trees.
The following example shows the use of the + operator to create an XName from an XNamespace and a local name.