I get the following error when I try to run my java program(it\'s supposed to read an xml file and print out some of the content).
From what I understand there is an
/**
* This Inner class is written to solve the XML parsing DTD validation
* checking from online because if Internet is not connected, then it
* throws Exception.
*
* @author Ravi Thapa
*/
public class CustomEntityResolver implements EntityResolver
{
public InputSource resolveEntity(String publicId, String systemId)
{
InputSource source = null;
Pattern pattern1 =
Pattern.compile("^-//(.*)//DTD(.*)$", Pattern.CASE_INSENSITIVE);
Matcher match1 = pattern1.matcher(publicId.trim());
Pattern pattern2 =
Pattern.compile("^http://(.*).dtd$", Pattern.CASE_INSENSITIVE);
Matcher match2 = pattern2.matcher(systemId.trim());
if (match1.find() || match2.find())
{
source = new InputSource(new ByteArrayInputStream("".getBytes()));
}
// return null to signal default behavior
return source;
}
}