Creates (or retrieves from cache) an XNamespace for the given URI.
The namespace URI string.
OptionalpreferredPrefix: string | nullOptional preferred prefix for serialization.
Static ReadonlynoneThe empty namespace (no namespace).
Static ReadonlyxmlThe http://www.w3.org/XML/1998/namespace namespace (xml prefix).
Static ReadonlyxmlnsThe http://www.w3.org/2000/xmlns/ namespace (xmlns prefix).
ReadonlyuriThe namespace URI string.
Returns the preferred serialization prefix for this namespace, or null
if none has been set.
Alias for uri. Returns the namespace URI string.
StaticgetReturns a cached XNamespace for the given URI.
The namespace URI string.
The cached XNamespace instance.
StaticgetReturns the empty (no-namespace) XNamespace.
StaticgetReturns the xml namespace (http://www.w3.org/XML/1998/namespace).
StaticgetReturns the xmlns namespace (http://www.w3.org/2000/xmlns/).
Returns the namespace URI wrapped in braces ({uri}), enabling
Clark-notation via string concatenation.
"{uri}" or "" for the empty namespace.
Compares this namespace to another by identity (interned reference equality).
The namespace to compare against.
true if both are the same interned instance.
Represents an XML namespace URI.
Remarks
Like XName, namespace instances are cached/interned: two XNamespace objects for the same URI are the same object.
Three well-known static namespaces are provided: XNamespace.none, XNamespace.xml, and XNamespace.xmlns.
The toString method returns
{uri}, which enables Clark-notation via string concatenation:XNamespace.get(uri) + "localName"evaluates to"{uri}localName".Example