-
anyone have experience on manipulating XML document with ASP.NET?
I'm trying to load a xml file then append a child then save it. This is similiar to what I have..
reader = new XmlTextReader (Server.MapPath("abc.xml"))
reader.WhitespaceHandling = WhitespaceHandling.None
reader.MoveToContent()
reader.Read()
xmlDoc.Load(reader)
reader.Close
Dim root As XmlNode = xmlDoc.DocumentElement
Dim elem As XmlElement = xmlDoc.CreateElement("abc")
Dim fr As XmlAttribute = xmlDoc.CreateAttribute("from")
fr.Value = "whatever"
elem.SetAttributeNode(fr)
root.AppendChild(elem)
xmlDoc.Save(Server.MapPath("abc.xml"))
what must I do differently to make this work..?
Thank you.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|