With my current insertion method I get this as a result:
<colors />
<colorname></colorname>
<colorfavorites></colorfavorites>
<nextcolor>.</nextcolor>
<newcolor />
But I want this:
<colors >
<colorname></colorname>
<colorfavorites></colorfavorites>
<nextcolor>.</nextcolor>
<newcolor />
</colors>
Here is My code:
'Open the XML Document
Dim myXmlDocument As New System.Xml.XmlDocument()
myXmlDocument.Load(Server.MapPath("../XML/colors.xml"))
Dim myXmlNode As System.Xml.XmlNode = myXmlDocument.DocumentElement.FirstChild
'Create A New Element And Populate Its Attributes
Dim myXmlElement As System.Xml.XmlElement = myXmlDocument.CreateElement("colors")
'Insert New Element into XmlTree And Save
myXmlDocument.DocumentElement.InsertBefore(myXmlElement, myXmlNode)
'Create A New Element And Populate Its Attributes and Insert, and Save
Dim myXmlElement2 As System.Xml.XmlElement = myXmlDocument.CreateElement("colorname")
myXmlElement2.InnerText = Server.HtmlEncode(txtCo.Text)
myXmlDocument.DocumentElement.InsertBefore(myXmlEle
View Complete Post