devxlogo

Build an Entity Resolver to Redirect a SAX Parser

This tip shows you how to bulid an entity resolver to “change” a public indentifier into a system identifier. The idea is to override the resolveEntity method of the EntityResolver interface:

public InputSource resolveEntity(String id_public,String id_system){   if (id_public.equals("-//W3C//DTD XHTML 1.0 Transitional//EN"))      return(new InputSource(         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"));          return null;       }

Charlie has over a decade of experience in website administration and technology management. As the site admin, he oversees all technical aspects of running a high-traffic online platform, ensuring optimal performance, security, and user experience.

See also  Seven Service Boundary Mistakes That Create Technical Debt

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.