I'm trying to add a new element to an existing list of elements in an XML file. I'm using this code to initiate the Element:
Dim newElem As XmlElement = doc.CreateElement("/Content/Catalog/Feature[7]/Option")
But I get an error message saying I can't use the "/" character. Not sure how to resolve this?
UPDATE: I'm adding two images, the 1st is a view of the XML file and where the data resides. File:OriginalXML The highlighted in blue items are what I am wanted to add (does not have to be at the top of the list, appending the data is probably better). The DisplayName, MultiMedia and CustomData as simple CDATA text. The second file is what happens when I run your code. (AfterCode.jpg). Note the highlighted "Option" seems to be in the wrong place and the formatting is lost. If you want to look at the original XML file, here it is: http://www.kwhdesign.ca/Temp/paf.xml
![OriginalXML] http://www.kwhdesign.ca/Temp/OriginalXML.jpg
(I can't post more than 2 links, so I'll try the second image in another comment)
Hope this helps! thanks again!