Private Sub bt_insert_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt_insert.Click
' Insertar el nodo asdf, después del nodo TipoDTE
'doc.PreserveWhitespace = True
doc.Load("DTE33.xml")
Dim elem As XmlNode = doc.CreateElement("asdf")
elem.InnerXml = "456"
Dim node As XmlNode = doc.GetElementsByTagName("IdDoc")(0)
Dim x As XmlElement = doc.GetElementsByTagName("IdDoc")(0).Item("TipoDTE") 'node("TipoDTE")
node.InsertAfter(elem, x)
doc.Save("DTE33.xml")
End Sub
fuente
No hay comentarios.:
Publicar un comentario