954,517 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

create XML element with namespace

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
  doc.DocumentElement.AppendChild(xmlEl)
  Return xmlEl
EndFunction


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

I expect the result:
Peter

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

Why?????

Mike

MikeLI
Newbie Poster
2 posts since Jun 2006
Reputation Points: 10
Solved Threads: 0
 

I got the same problme

yong9900
Newbie Poster
1 post since Jul 2006
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You