← Prev in month
← Prev in thread
Next in thread →
Next in month →
Problems with EntityResolver
Hi All,
I am having a strange problem with my XML Parser. I want to use the DTD
validations when I am parsing my XML file. My EntityResolver class looks
like this:
public class MyEntityResolver implements EntityResolver
{
public InputSource resolveEntity(String publicId, String systemId) throws
SAXException
{
InputSource result = null;
result = new InputSource("TRRQCR.dtd");
return result;
}
}
TRRQCR.dtd is the DTD file located in the same directory as
MyEntityResolver.
In the parser class I am setting EntityResolver this way:
parser.setEntityResolver(new ExelEntityResolver());
When I parse my XML file it works without any problem. But when I specify
an element which is not defiened in this TRRQCR.dtd also it parses fine. I
expected the parser to throw an exception. Am I missing something?
Thanks & Regards,
Rajesh
← Prev in month
← Prev in thread
Next in thread →
Next in month →