Hi All,
I have a function. It creates an XML element:
Then, I call that function in this way:
newElement(xmlDoc, "FirstName", "Peter", "pref")
I expect the result:
<pref:FirstName>Peter</FirstName>
However, the result has no "pref:", just:
<FirstName>Peter</FirstName>
Why?????
Mike
I have a function. It creates an XML element:
VB.NET:
[FONT=Courier New]Function newElement(ByVal doc As XmlDocument, [/FONT]
[FONT=Courier New] ByVal name As String, _ [/FONT]
[FONT=Courier New] Optional ByVal text As String = Nothing, _ [/FONT]
[FONT=Courier New] Optional ByVal pref As String = Nothing) As XmlElement [/FONT]
[FONT=Courier New] Dim xmlEl As XmlElement = doc.CreateElement(pre, name, "") [/FONT]
[FONT=Courier New] If Not (text Is Nothing) Then xmlEl.InnerText = text [/FONT]
[FONT=Courier New] doc.DocumentElement.AppendChild(xmlEl) [/FONT]
[FONT=Courier New] Return xmlEl[/FONT]
[FONT=Courier New]End Function[/FONT]
Then, I call that function in this way:
newElement(xmlDoc, "FirstName", "Peter", "pref")
I expect the result:
<pref:FirstName>Peter</FirstName>
However, the result has no "pref:", just:
<FirstName>Peter</FirstName>
Why?????
Mike