Gets a value indicating whether the supplied prefix has a namespace defined for the current pushed scope.
Public Overridable Function HasNamespace ( _ prefix As String _ ) As Boolean
Dim instance As XmlNamespaceManager Dim prefix As String Dim returnValue As Boolean returnValue = instance.HasNamespace(prefix)
public virtual bool HasNamespace( string prefix )
public: virtual bool HasNamespace( String^ prefix )
public function HasNamespace( prefix : String ) : boolean
To determine whether there is a default empty namespace defined, set prefix to String.Empty. If the method returns true, this indicates that there is a default namespace defined in the current scope. Returning false indicates that no default namespace is defined.
xmlns:x= "" is illegal according to W3C Namespaces in XML recommendation.
The following example displays the default namespace, if one exists.
If nsmgr.HasNamespace(String.Empty) Then Console.WriteLine(nsmgr.DefaultNamespace) End If
if (nsmgr.HasNamespace(String.Empty)) Console.WriteLine(nsmgr.DefaultNamespace);
if ( nsmgr->HasNamespace( String::Empty ) ) { Console::WriteLine( nsmgr->DefaultNamespace ); }
if (nsmgr->HasNamespace(String::Empty)) Console::WriteLine(nsmgr->DefaultNamespace);
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98, Windows CE, Windows Mobile for Smartphone, Windows Mobile for Pocket PC, Xbox 360, Zune