Solved

Setting SetEntityResolver with SAXParser

Posted on 2008-06-24
2
539 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

864 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now