Solved

Setting SetEntityResolver with SAXParser

Posted on 2008-06-24
2
545 Views
Last Modified: 2012-05-05
I have the following code to set the XMLParser entity resolver

saxParser.getXMLReader().setEntityResolver(new CustomEntityResolver());

The CustomEntityResolver looks something like this

public InputSource resolveEntity(String publicId, Strprivate class CustomEntityResolver implements EntityResolver {
  public InputSource resolveEntity(String publicId, String systemId) {
    System.out.println("Resolving: "+systemId);
    .....
}

However that system.out statement never gets called. Can someone please explain how I can fix this. Basically we are trying to get the SaxParser not to crash if they have do not have Internet access and supplying the location of the local file.

Thanks in advance
0
Comment
Question by:harlanhugh
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 

Author Comment

by:harlanhugh
ID: 21862885
I solved this one.  Need to override the resolveEntity for the DefaultHandler.
0
 

Accepted Solution

by:
EE_AutoDeleter earned 0 total points
ID: 22286912
Akhilesh007,
Because you have presented a solution to your own problem which may be helpful to future searches, this question is now PAQed and your points have been refunded.

EE_AutoDeleter
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
jmss example java 2 48
ejb message driven bean mdb creation steps 2 54
Java basic valueOf question 1 50
java mysql insert application 14 68
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
The viewer will learn how to implement Singleton Design Pattern in Java.
Suggested Courses

737 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question