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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T01:50:19+00:00 2026-06-10T01:50:19+00:00

A piece of HTML that I’m trying to parse contains some attributes values without

  • 0

A piece of HTML that I’m trying to parse contains some attributes values without quotation marks, for example with width and height attributes:

<img src="/static/logo.png" width=75 height=90 />

In the C# code, the reader reads until the next anchor tag.

while (reader.ReadToFollowing("a"))

This statement reports a XmlException:

'75' is an unexpected token. The expected token is '"' or '''. Line 16, position 37.

Is there some XmlReaderSetting to make the XmlReader more lenient? I do not have control over the generated HTML.

  • 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-10T01:50:21+00:00Added an answer on June 10, 2026 at 1:50 am

    In order to read HTML, you’ll need a reader designed for that purpose. The HtmlAgilityPack can help you here, as can the SgmlReader referred to in this answer to a related question.

    HTML is not XML. They are both based on SGML, but follow different rules. XML has much stricter rules than HTML, which include the need to close all tags and for attributes to be surrounded with single or double quotes. Therefore, unless you are parsing XML-compliant XHTML, XmlReader will not work for you.

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

Sidebar

Related Questions

I am trying to convert this piece of html code to javascript so that
Let's imagine that we have some piece of html with appended actions. var html
so I obtained a piece of html code from a PHP site that returns
I have a PHP page that returns a piece of HTML to set the
This is HTML code piece that in my template: {%load thumbnail%} <img style=border: 1px
I have the following piece of HTML: <style type=text/css> #c{width:200px;height:500px} </style> <canvas id=c></canvas> <script
I have this piece of HTML: <div class=embed> <iframe width=300 height=200 frameborder=0 allowfullscreen= src=http://www.youtube.com/embed/123456></iframe>
I have a piece of html that, when JQM is done with it, looks
Here is a piece of HTML that does not display well in Firefox (10)
I have 1M html files that I need to parse and then insert the

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.