Solved

Setting SetEntityResolver with SAXParser

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
hash value 2 38
json example 39 113
advertisement module in core php 4 87
Java passing arguments (type error) 2 35
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)
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

706 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

18 Experts available now in Live!

Get 1:1 Help Now