devxlogo

Build an Entity Resolver to Redirect a SAX Parser

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;       }
devxblackblue

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.

About Our Journalist