Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding a child node end up with namespace
Message
From
20/06/2012 11:31:24
 
 
To
All
General information
Forum:
ASP.NET
Category:
XML
Title:
Adding a child node end up with namespace
Environment versions
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01546444
Message ID:
01546444
Views:
81
I have this method to add a child node:
        ' Add an element
        ' expC1 Node
        ' expC2 Element
        Public Function AddXMLElement(ByVal tcNode As String, ByVal tcElement As String) As Boolean

            ' Create the node
            Try
                oXmlElement = oXmlDocument.CreateElement(tcElement)
            Catch loError As Exception
                cMessage = loError.Message
                Return False
            End Try

            ' Select the node
            If oXmlNameSpaceManager Is Nothing Then
                oXmlNode = oXmlDocument.SelectSingleNode(tcNode)
            Else
                oXmlNode = oXmlDocument.SelectSingleNode(tcNode, oXmlNameSpaceManager)
            End If

            ' See if we obtained the node
            If oXmlNode Is Nothing Then
                cMessage = oApp.StrTran(cNodeDoesNotExist, "##Node##", tcNode)
                Return False
            End If

            ' Add the node
            oXmlNode.AppendChild(oXmlElement)

            cXML = oXmlDocument.OuterXml
            Return True
        End Function
However, I get the result:
<ReferenceInfo xmlns=""/>
How to avoid the namespace to be added in there?
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Next
Reply
Map
View

Click here to load this message in the networking platform