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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:50:58+00:00 2026-05-26T03:50:58+00:00

I am trying to load something which claims to be an XML document into

  • 0

I am trying to load something which claims to be an XML document into any type of .net XML object: XElement, XmlDocument, or XmlTextReader. All of them throw an exception :

Name cannot begin with the ‘0’ character, hexadecimal value 0x30

The error related to a bit of ‘XML’

<chart_value 
    color="ff4400" 
    alpha="100" 
    size="12" 
    position="cursor" 
    decimal_char="." 
    0="" 
/>

I believe the problem is the author should not have named an attribute as 0.

If I could change this I would, but I do not have control of this feed. I suppose those who use it are using more permissive tools. Is there anyway I can load this as XML without throwing an error?

There is no XML declaration either, nor namespace or contract definition. I was thinking I might have to turn it into a string and do a replace, but this is not very elegant. Was wondering if there was any other options.

  • 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-26T03:50:58+00:00Added an answer on May 26, 2026 at 3:50 am

    As many have said, this is not XML.

    Having said that, it’s almost XML and WANTS to be XML, so I don’t think you should use a regex to screw around inside of it (here’s why).

    Wherever you’re getting the stream, dump into into a string, change 0= to something like zero= and try parsing it.

    Don’t forget to reverse the operation if you have to return-to-sender.


    If you’re reading from a file, you can do something like this:

            var txt = File.ReadAllText(@"\path\to\wannabe.xml");
            var clean = txt.Replace("0=", "zero=");
            var doc = new XmlDocument();
            doc.LoadXml(clean);
    

    This is not guaranteed to remove all potential XML problems — but it should remove the one you have.

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

Sidebar

Related Questions

I'm trying to port some code into .net which has a load of #define'd
I'm trying to load data into the html5 canvas roulette which I found here:
When trying to load Microsoft.Xna.Framework.dll from any project, it throws a FileNotFoundException. The specified
I am trying to load Linq on my .Net 3.5 enabled web server by
I am trying to load UIImage object from NSData , and the sample code
I have an Excel file that I am trying to load into R using
I am trying to load an image file (gif) which is stored locally in
I have a page which lists a load of portfolios. I am trying to
I am using Ruby on Rails and am trying to load a page which
I'm trying to load a file into a string. Here is the code I'm

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.