Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9224293
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T04:17:02+00:00 2026-06-18T04:17:02+00:00

I have a program that inserts a new lesson to a course XML. Here

  • 0

I have a program that inserts a new lesson to a course XML. Here is the XML file:

Course.xml

<Courses>

   <Course>
      <Name>ABC course</Name>
      <Lessons>
         <Lesson>
           <Lesson_name>Learn ABC!</Lesson_name>
           <Lesson_date>XX/XX/XXXX</Lesson_date>
         </Lesson>


        'WANT TO ADD A LESSON HERE!!!


      </Lessons>
   </Course>

   <Course>
      <Name>DEF Course</Name>
      <Lesson>
        <Lesson_name>Learn DEF!</Lesson_name>
        <Lesson_date>XX/XX/XXXX</Lesson_date>
      </Lesson>
   </Course>

</Courses>

I would want to insert a lesson with all those nodes such as Lesson, Lesson_date, Lesson_name etc. without affecting the existing lessons and other elements. Is there any simple way?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T04:17:04+00:00Added an answer on June 18, 2026 at 4:17 am

    Something like this should work:

    Dim xmlDoc As XmlDocument = New XmlDocument()
    xmlDoc.Load("Course.xml")
    
    Dim courseName = "ABC course"
    With xmlDoc.SelectSingleNode("/Courses/Course[Name = '" & courseName & "']/Lessons").CreateNavigator().AppendChild()
        .WriteStartElement("Lesson")
        .WriteElementString("Lesson_name", "Learn something else!")
        .WriteElementString("Lesson_date", "YY/YY/YYYY")
        .WriteEndElement()
        .Close()
    End With
    

    If you want to modify the actual file, you could use xmlDoc.Save() after that.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a table with a CreateDateTime PK. The program that does the inserts
I have a program that reads from a file that grabs 4 bytes from
I have a VB.Net program that reads in a flat file, and then parses
I have a program that inserts data in access database and the user can
I have a program that inserts values into a table in a local database.
I have to make a program that basically reads x lines from a file
I have a Java program that reads some text from a file, line by
I have a Datatable in my C# program that I would like to INSERT
I have program that requires Python 3, but I develop Django and it uses
I have program that has a variable that should never change. However, somehow, it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.