> ' Add a namespace > Public Function AddNamespace() As Boolean > Dim lcNamespace As String = "" > Dim lcUri As String = "" > Dim llSuccess As Boolean = False > > ' Reset the values > cMessage = "" > > ' Initialization > lcNamespace = Trim(cNamespace) > lcUri = Trim(cUri) > > ' If we have a Uri > If lcUri.Length > 0 Then > > ' If we have a namespace > If lcNamespace.Length > 0 Then > > Try > > ' Create the XmlNameSpaceManager object once > ' This is needed as we could add several namespaces > If oXmlNameSpaceManager Is Nothing Then > oXmlNameSpaceManager = New XmlNamespaceManager(oXmlDocument.NameTable) > End If > > oXmlNameSpaceManager.AddNamespace(lcNamespace, lcUri) > llSuccess = True > Catch loException As Exception > cMessage = loException.Message > End Try > > Else > cMessage = cYouNeedToDefineTheNamespaceProperty > End If > Else > cMessage = cYouNeedToDefineTheUriProperty > End If > > ' Reset the values > cNamespace = "" > cUri = "" > > Return llSuccess > End Function >>