Place textbox text into XML element

Hi all

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" ?>
- <page>
- <content>
-  <freetext>
-   <freetexts>
      <html> *Ammended Text to be overwritten from VB Text box*</html>  
     </freetexts>
    </freetext>
   </content>
   </page>

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

xml.Load (FullPath)

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*

Next

End Sub

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
Zorac_da_mantisAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

plqCommented:
n.text = textbox.text

Thats it.

if its a sub node

n.selectSingleNode("html").text = textbox.text

Then at the end do

xml.Save FullPath
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
plqCommented:
Ooh if you're using .NET replace n.text with n.InnerText
0
Zorac_da_mantisAuthor Commented:
Top answer
Thanks

Thanks for the quick response!!!

0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Programming

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.