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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T01:44:45+00:00 2026-05-14T01:44:45+00:00

First off, let me say I am a new to SAX and Java. I

  • 0

First off, let me say I am a new to SAX and Java.

I am trying to read information from an XML file that is not well formed.

When I try to use the SAX or DOM Parser I get the following error in response:

The markup in the document following the root element must be well-formed.

This is how I set up my XML file:

<format type="filename" t="13241">0;W650;004;AG-Erzgeb</format>
<format type="driver" t="123412">001;023</format>
   ...

Can I force the SAX or DOM to parse XML files even if they are not well formed XML?

Thank you for your help. Much appreciated.
Haythem

  • 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-14T01:44:46+00:00Added an answer on May 14, 2026 at 1:44 am

    Your best bet is to make the XML well-formed, probably by pre-processing it a bit. In this case, you can achieve that simply by putting an XML declaration on (and even that’s optional) and providing a root element (which is not optional), like this:

    <?xml version="1.0"?>
    <wrapper>
        <format type="filename" t="13241">0;W650;004;AG-Erzgeb</format>
        <format type="driver" t="123412">001;023</format>
    </wrapper>
    

    There I’ve arbitrarily picked the name “wrapper” for the root element; it can be whatever you like.

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

Sidebar

Related Questions

First off, let me start by saying that I am totally new to working
First off let me just say I'm very new to coding so there are
First off, please let me say I'm pretty new to CSS. Still lots to
First off, I'm coming (back) to Java from C#, so apologies if my terminology
First off, I would like to make clear, that I am SUPER NEW TO
First off I want to say that I wasn't really sure where to post
Preface Let me start off by saying that I'm a relatively new programmer and
Let say I retrieve my list of data... First $Query = mysql_query(SELECT * FROM
First of all, let me say I am very new to rails, have been
First off, let me preface this question by saying that my professor is firmly

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.