Categories
BLOG

xname bubbler

XNamespace. Get Name(String) Method

Definition

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

Parameters

A String that contains a local name.

Returns

An XName created from this XNamespace and the specified local name.

Examples

The following example uses this property to retrieve an XName.

This example produces the following output:

Remarks

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

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

XNamespace. Addition(XNamespace, String) Operator

Definition

Combines an XNamespace object with a local name to create an XName.

Parameters

An XNamespace that contains the namespace.

A String that contains the local name.

Returns

The new XName constructed from the namespace and local name.

Examples

The following example shows the use of the + operator to create an XName from an XNamespace and a local name.

In Visual Basic, this is the preferred idiom:

This example produces the following output:

Remarks

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.

Combines an XNamespace object with a local name to create an XName. ]]>