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 6952599
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:22:12+00:00 2026-05-27T14:22:12+00:00

I have two rich text boxes, and two buttons on my screen. The first

  • 0

I have two rich text boxes, and two buttons on my screen. The first button grabs HTML from a URL and then converts the HTML to XML which resides in rich text box 1.

The second button is to grab the XML from the rich text box1 and then parse it to grab all the input elements by their ID.

My issue is that my parser isn’t doing anything. My guess is that I’m not quite getting the XML from the first rich text box.

What would be the best way to grab the XML from a rich text box load it into memory and then parse the XML to grab all the ID tags?

Here is my code — Thanks for any help.

Imports mshtml
Imports System.Text
Imports System.Net
Imports System.Xml
Imports System.IO
Imports System.Xml.XPath

Public Class Scraper

    Private Sub Scraper_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        '  Note: This example uses two Chilkat products: Chilkat HTTP
        '  and Chilkat HTML-to-XML.  The "Chilkat Bundle" can be licensed
        '  at a price that is less than purchasing each product individually.
        '  The "Chilkat Bundle" provides licenses to all existing Chilkat components.  Also, new-version upgrades are always free.

        Dim http As New Chilkat.Http()

        '  Any string argument automatically begins the 30-day trial.
        Dim success As Boolean
        success = http.UnlockComponent("30-day trial")
        If (success <> True) Then
            TextBox1.Text = TextBox1.Text & http.LastErrorText & vbCrLf
            Exit Sub
        End If

        Dim html As String
        html = http.QuickGetStr("http://www.quiltingboard.com/register.php")
        If (html = vbNullString) Then
            TextBox1.Text = TextBox1.Text & http.LastErrorText & vbCrLf
            Exit Sub
        End If

        Dim htmlToXml As New Chilkat.HtmlToXml()

        '  Any string argument automatically begins the 30-day trial.
        success = htmlToXml.UnlockComponent("30-day trial")
        If (success <> True) Then
            TextBox1.Text = TextBox1.Text & htmlToXml.LastErrorText & vbCrLf
            Exit Sub
        End If

        '  Indicate the charset of the output XML we'll want.
        htmlToXml.XmlCharset = "utf-8"

        '  Set the HTML:
        htmlToXml.Html = html

        '  Convert to XML:
        Dim xml As String
        xml = htmlToXml.ToXml()

        '  Save the XML to a file.
        '  Make sure your charset here matches the charset
        '  used for the XmlCharset property.
        htmlToXml.WriteStringToFile(xml, "out.xml", "utf-8")

        RichTextBox1.Text = xml
    End Sub

    Private Sub LoopThroughXmlDoc(ByVal nodeList As XmlNodeList)
        For Each elem As XmlElement In nodeList
            If elem.HasChildNodes Then
                LoopThroughXmlDoc(elem.ChildNodes)
            Else
                '' Extract the information
                If elem.HasAttribute("id") Then
                    'elem.Attributes("AssetID").Value.ToString()
                ElseIf elem.HasAttribute("name") Then
                    'elem.Attributes("AttributeID").Value.ToString()
                End If
            End If
        Next
    End Sub

    Private Sub Button2_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Dim doc As XmlDocument = New XmlDocument
        doc.Load("xmlFile.xml")
        Dim nodeList As XmlNodeList = doc.GetElementsByTagName("input")
        LoopThroughXmlDoc(nodeList)
    End Sub
End Class
  • 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-05-27T14:22:13+00:00Added an answer on May 27, 2026 at 2:22 pm

    The second button doesn’t grab the XML from the RichTextBox, it attempts to load it from xmlFile.xml.

    This file is different than the one that is saved to in button1, which is out.xml.

    If the user can change the XML in the richtextbox, then the solution is to change the code in button2 to retrieve the text from the RTB.

    Otherwise, the solution is to change the name of the file being read in button2 to out.xml.

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

Sidebar

Related Questions

I want to append the contents of two rich text boxes in a Windows
I have two identical tables and need to copy rows from table to another.
We have two forms where we need to pass values from one to the
I have two TextRanges from two different RichTextBoxes, and four strings from regular textboxes.
So, I'm developing an app and need to have two buttons pressed at the
I am using two forms, where one is a rich text editor with menus
I have a rich text box and I've implemented a search option for it.
Iam using tinymce_hammer as a rich text editor. But now i have a form
Have two folders with approx. 150 java property files. In a shell script, how
I have two applications written in Java that communicate with each other using XML

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.