Place textbox text into XML element
Posted on 2004-11-10
I am in desperate need of assitance. I have a VB6 program that splits text out of XML documents using FileSystemObjet and iot does all that I need, however when it comes time to place the ammended text back into the relevant XML elements I am getting very stuck. The file structure is as follows. This is extremely urget for me. If you can provide a .NET example that is also ok.
<?xml version="1.0" encoding="utf-8" ?>
<html> *Ammended Text to be overwritten from VB Text box*</html>
THe code I have so far is as follows:
Private Sub PopulateXml()
Dim xml As New msXML.DOMDocument
Dim nList As msXML.IXMLDOMNodeList
Dim n As msXML.IXMLDOMNode
Dim tmpStr As String
Set nList = xml.documentElement.getElementsByTagName("html")
For Each n In nList
*code to append the existing html element with text from Text1.txt*
*something like n.appendChild(tmpStr) im not sure*
I have looked at many examples on the net using DOM objects but I just cant understand how to assign the actual text string to a node and then append the node.
Please could someone explain how to do this.
Many thanks in advance