jgibbens
-
Total Posts
:
2
- Scores: 0
-
Reward points
:
0
- Joined: 2/20/2008
-
Status: offline
|
Visual Basic 2005 newb in need of some XML write to file help
Wednesday, February 20, 2008 3:10 AM
( permalink)
Original message moved by ebgreen Reason : Moved to proper forum Visual Basic 2005 newb in need of some XML write to file help First, thank you for even looking at my question. I am using VB 2005 and I have a question about XML. what I want to do is: 1. keep adding to this file with out over writing it 2. be able to change stuff the XML without overwriting the rest of the file This is the XML I have: <presentation courseName="" lesson=""> <modules> <module> <title hide=""></title> <imageLoc url=""></imageLoc> <bullets> <bullet></bullet> </bullets> <bdyhtmlText>worker</bdyhtmlText> <checkPoint hide=""> <question></question> <answers> <answer resp=""></answer> <correctAnswer></correctAnswer> </answers> </checkPoint> </module> </modules> </presentation> I have this code that writes the initial XML: Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load End Sub Private Sub SaveToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveToolStripMenuItem.Click Dim setting As Xml.XmlWriterSettings = New Xml.XmlWriterSettings() setting.Indent = True setting.NewLineOnAttributes = True Dim xw As Xml.XmlWriter = Xml.XmlWriter.Create("C:\Documents and Settings\gibbensj\Desktop\new writer test feb 20 2008\WindowsApplication1\books.xml", setting) xw.WriteStartDocument() xw.WriteStartElement("presentation") xw.WriteStartElement("modules") xw.WriteStartElement("module") xw.WriteElementString("title", titleBx.Text) xw.WriteElementString("imageLoc", slideBx.Text) xw.WriteStartElement("bullets") xw.WriteElementString("bullet", "") xw.WriteEndElement() xw.WriteElementString("bdyhtmlText", bodyBx.Text) xw.WriteStartElement("checkpoint") xw.WriteEndElement() xw.WriteEndElement() xw.WriteEndElement() xw.WriteEndDocument() xw.Flush() xw.Close() End Sub End Class How would I go about this? I am loving VB but it is very difficult. My hats off to those of you who are productive with it. Thank you for any help, in advance. -J
|
|
|
|
ebgreen
-
Total Posts
:
8227
- Scores: 98
-
Reward points
:
0
- Joined: 7/12/2005
-
Status: offline
|
RE: Visual Basic 2005 newb in need of some XML write to file help
Wednesday, February 20, 2008 3:16 AM
( permalink)
You should be aware that VBScript (which is what this site is focused on) is vastly different from VB .Net. You may happen across someone here that knows the answer off the top of their head, but you would be more likely to get an answer at a VB .Net site.
|
|
|
|