Hi All,

I have a function. It creates an XML element with namespace "pre":

Function newElement(ByVal doc  As XmlDocument, _
                             ByVal Name As String, _
                Optional ByVal text As String = Nothing, _
                Optional ByVal pre  As String = Nothing) As XmlElement
  Dim xmlEl As XmlElement = doc.CreateElement(pre, Name, "")
  If Not (text IsNothing) Then xmlEl.InnerText = text
  Return xmlEl

Then, I call that function in this way:
newElement(xmlDoc, "FirstName", "Peter", "pre")

I expect the result:

However, the result has no "pre:", just:



This article has been dead for over six months. Start a new discussion instead.