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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T02:01:03+00:00 2026-05-23T02:01:03+00:00

I am parsing a MathML expression with SAX (although the fact that it’s MathML

  • 0

I am parsing a MathML expression with SAX (although the fact that it’s MathML may not be completely relevant). An example input string is

<math xmlns='http://www.w3.org/1998/Math/MathML'>
     <mrow>
          <mo>&lambda;</mo>
     </mrow>
</math>

In order for the SAX parser to accept this string, I expand it a bit:

<?xml version="1.0"?>
     <!DOCTYPE doc_type [
          <!ENTITY nbsp "&#160;">
          <!ENTITY amp "&#38;">
]>
<body>
     <math xmlns='http://www.w3.org/1998/Math/MathML'>
          <mrow>
               <mo>&lambda;</mo>
          <mrow>
     </math>
</body>

Now, when I run the SAX parser on this, I get an exception:

[Fatal Error] :5:86: The entity "lambda" was referenced, but not declared.
org.xml.sax.SAXParseException: The entity "lambda" was referenced, but not 
                               declared.
    at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)

However, I know how to fix that. I simply add this line to the string being parsed:

        <!ENTITY lambda "&#923;">

This gives me

<?xml version="1.0"?>
     <!DOCTYPE doc_type [
          <!ENTITY nbsp "&#160;">
          <!ENTITY amp "&#38;">
          <!ENTITY lambda "&#923;">
]>
<body>
     <math xmlns='http://www.w3.org/1998/Math/MathML'>
          <mrow>
               <mo>&lambda;</mo>
          <mrow>
     </math>
</body>

Now, it parses just fine, thank you.

However, the problem is that I can’t add an ENTITY declaration for every possible character entity that might be used in MathML (for example, “part”, “notin”, and “sum”).

How do I rewrite this string so that it can be parsed for any possible character entity that might be included?

  • 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-23T02:01:04+00:00Added an answer on May 23, 2026 at 2:01 am

    Use a DOCTYPE declaration that refers to the MathML DTD:

    <!DOCTYPE math 
        PUBLIC "-//W3C//DTD MathML 3.0//EN"
               "http://www.w3.org/Math/DTD/mathml3/mathml3.dtd">
    

    or a local copy of the same.

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

Sidebar

Related Questions

I'm parsing RTF 1.5+ files generated by Word 2003+ that may have content from
I have some XML that I'm parsing with a SAX parser in Java. It
I'm parsing a long string and want to use a regular expression for part
While parsing the XML with SAX parser in JAVA, I am not able to
I'm parsing text from a file and storing it in a string. The problem
I'm looking at parsing a delimited string, something on the order of a,b,c But
I've been parsing through some log files and I've found that some of the
I am parsing text that has a heading and then data that applies to
I was trying to parse mathml document using JScience but was not succeed. Following
I am currently parsing XML, but im not quite sure how to parse 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.