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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:36:26+00:00 2026-05-25T12:36:26+00:00

I have an asp.net vb project that needs to parse some raw XML that

  • 0

I have an asp.net vb project that needs to parse some raw XML that is coming out of a database the XML is laid out like this:

<HTML><HEAD><TITLE></TITLE></HEAD><BODY><STRONG><A name=SN>AARTS</A>, <A name=GN>Michelle Marie</A>, </STRONG><A name=HO>B.Sc.</A>, <A name=HO>M.Sc.</A>, <A name=HO>Ph.D.</A>; <A name=OC>scientist, professor</A>; b. <A name=BC>St. Marys</A>, Ont. <A name=BY>1970</A>; <A name=PA>d. Wm. and H. Aarts</A>; <A name=ED>e. Univ. of Western Ont. B.Sc.(Hons.) 1994, M.Sc. 1997</A>; <A name=ED>McGill Univ. Ph.D. 2002</A>; <A name=MA>m. L. MacManus</A>; two children; <A name=PO>CANADA RESEARCH CHAIR IN SIGNAL TRANSDUCTION IN ISCHEMIA</A> and <A name=PO>ASST. PROF., DEPT. OF BIOL. SCI., UNIV. OF TORONTO SCARBOROUGH 2006&ndash;&nbsp;&nbsp;</A>; Postdoctoral Fellow, Toronto Western Hosp. 2000&ndash;06; Expert Cons., Auris Med. SAS, Montpellier, France; mem., Centre for the Neurobiol. of Stress; named INMHA Brainstar of the Year 2003; Bd. of Dirs. &amp; Fundraising Chair, N'Sheemaehn Childcare; mem., Soc. for Neurosci.; Cdn. Physiol. Soc.; Cdn. Assn. for Neurosci.; <A name=WK>co-author: 'Therapeutic Tools in Brain Damage' in <EM>Proteomics and Protein Interactions: Biology, Chemistry, Bioinformatics and Drug Design </EM>2005; 18 pub. journal articles</A>; Office: <A name=OF1_L1>1265 Military Trail</A>, <A name=OF1_CT>Scarborough</A>, <A name=OF1_PR>Ont.</A> <A name=OF1_PC>M1C 1A4</A>. </BODY></HTML>

And the code behind I’m using is this

        Dim FullBio As New System.Xml.XmlDocument
        Dim NodeList As System.Xml.XmlNodeList
        Dim Node As System.Xml.XmlNode

        FullBio.LoadXml(bio.Item(11))
        NodeList = FullBio.SelectNodes("a")

        For Each Node In NodeList
            Dim name = Node.Attributes.GetNamedItem("name").Value()
            lblEducation.Text = lblEducation.Text + name.ToString() + Node.InnerText + "<br />"
        Next

So the XML loaded into the Xml Document at

FullBio.LoadXml(bio.Item(11))

is the XML I provided at the top. I am getting this error message:

'SN' is an unexpected token. The expected token is '"' or '''. Line 1, position 49.

I know that the error is because the attributes are not quoted. Is there anyway to make XmlDocument understand the attributes anyway or an easy way to use a reg expression to add quotes to the attributes before loading the string into the xmldoc?

  • 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-25T12:36:27+00:00Added an answer on May 25, 2026 at 12:36 pm

    What you have is invalid XML. An XmlDocument expects that the input is valid XML. I would recommend you using an HTML parser such as Html Agility Pack in order to parse HTML (which is what you have as input). So for example if you wanted to list all name attribute values for all anchors it’s as simple as that:

    using System;
    using HtmlAgilityPack;
    
    class Program
    {
        static void Main()
        {
            var document = new HtmlDocument();
            document.Load("test.html");
            foreach (var a in document.DocumentNode.Descendants("a"))
            {
                Console.WriteLine("Name: {0}", a.Attributes["name"].Value);
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an asp.net mvc project that uses some search methods in a seperate
We have an ASP.Net MVC project that will start with a single web server
I have an Asp.net MVC project that modestly uses jQuery scripts. My views also
Background : I have a asp.net webapplication project that should contain a public and
I have an ASP.NET VB.NET web project that references a VB.NET class library. I
I have an existing asp.net webforms project that uses Microsoft's Enterprise DAAB for the
I have an ASP.Net project using AJAX that I am putting on a server
I happen to have an ASP.NET 2.0 project that I want to apply a
I have a UserControl in my Asp.net project that has a public property. I
In visual studio, I have an asp.net 3.5 project that is using MS Enterprise

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.