This documentation is archived and is not being maintained.

XmlNamespaceManager.DefaultNamespace Property

Gets the namespace URI for the default namespace.

[Visual Basic]
Public Overridable ReadOnly Property DefaultNamespace As String
[C#]
public virtual string DefaultNamespace {get;}
[C++]
public: __property virtual String* get_DefaultNamespace();
[JScript]
public function get DefaultNamespace() : String;

Property Value

Returns the namespace URI for the default namespace, or String.Empty if there is no default namespace.

Remarks

This method is equivalent to calling LookupNamespace(String.Empty).

Example

[Visual Basic, C#, C++] The following example displays the default namespace, if one exists.

[Visual Basic] 
If nsmgr.HasNamespace(String.Empty) Then
    Console.WriteLine(nsmgr.DefaultNamespace)
End If

[C#] 
if (nsmgr.HasNamespace(String.Empty))
  Console.WriteLine(nsmgr.DefaultNamespace);

[C++] 
if (nsmgr->HasNamespace(String::Empty))
  Console::WriteLine(nsmgr->DefaultNamespace);

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework, Common Language Infrastructure (CLI) Standard

See Also

XmlNamespaceManager Class | XmlNamespaceManager Members | System.Xml Namespace | LookupNamespace

Show: