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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T00:31:19+00:00 2026-05-18T00:31:19+00:00

I get the following error when I try to run my java program(it’s supposed

  • 0

I get the following error when I try to run my java program(it’s supposed to read an xml file and print out some of the content).

From what I understand there is an unreferenced entity which is not part of the xml standard so my question is; how can I fix this problem?

Thanks,

[Fatal Error] subject.xml:4:233: The entity "rsquo" was referenced, but not declared.
org.xml.sax.SAXParseException: The entity "rsquo" was referenced, but not declared.
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
at DomParserExample2.parseXmlFile(DomParserExample2.java:42)
at DomParserExample2.runExample(DomParserExample2.java:24)
at DomParserExample2.main(DomParserExample2.java:115)
Exception in thread "main" java.lang.NullPointerException
at DomParserExample2.parseDocument(DomParserExample2.java:54)
at DomParserExample2.runExample(DomParserExample2.java:27)
at DomParserExample2.main(DomParserExample2.java:115)
  • 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-18T00:31:19+00:00Added an answer on May 18, 2026 at 12:31 am

    The entity ’ is not an XML-Entity. Its defined in HTML: http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references

    If you created the XML you can add entitiess to your DTD. To fix the issue, add a DTD to the XML file (if not already defined).

    XML:

    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <!DOCTYPE demo SYSTEM "./demo.dtd">
    <demo>
        &rsquo;
    </demo>
    

    DTD:

    <!ELEMENT demo (#PCDATA)>
    <!ENTITY rsquo   "&#8217;">
    

    Provide the DTD to the application and the error goes away. I wouldn’t write all entities myself, I would use one from W3C, such as: http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent

    How to include the DTD for your XML is another Question. As far as I remember you can set the path to the DTD, or an Catalog-File.

    edit 2:
    Take a look at the EntityResolver:
    http://download.oracle.com/javase/1.4.2/docs/api/org/xml/sax/EntityResolver.html

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

Sidebar

Related Questions

I'm getting the following error when I try to run a simple Java JDBC
I get the following error when I try to compile an asp.net site using
After installing VMware Server I get the following error when I try to access
When I try to do that I get the following error: Changes to 64-bit
I get the following error when trying to run the latest Cygwin version of
I'm writing a program in Java where I read in data from an XML
Why do I get following error when trying to start a ruby on rails
We get the following error; The request was aborted: Could not create SSL/TLS secure
I get the following error when running my Visual Studio 2008 ASP.NET project (start
I get the following error when building my Windows Forms solution: LC.exe exited with

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.