• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 549
  • Last Modified:

Setting SetEntityResolver with SAXParser

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
harlanhugh
Asked:
harlanhugh
1 Solution
 
harlanhughAuthor Commented:
I solved this one.  Need to override the resolveEntity for the DefaultHandler.
0
 
EE_AutoDeleterCommented:
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now