← Prev in month ← Prev in thread
Next in thread → Next in month →

Problems with EntityResolver

From
Rajesh AVRS <>
To
Date
2002-01-22T03:10:12Z
ID
<12c301c1a2f2$507932b0$9f1fc80a@ITPEXE107981>
Thread
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 →