Hello,

I've just written some simple code to find out whether
the XML I generate validates against a particular dtd
but I'm have some problems.  Here is my code:

parse( )
  {
    try
    {
      DOMParser domParser = new DOMParser( );

      java.io.FileInputStream inputStream = new
java.io.FileInputStream("C:\\ForImport.xml");

      InputSource is = new InputSource(inputStream);

   
domParser.setFeature("http://xml.org/sax/features/validation";
, true);

      domParser.setErrorHandler(new JarErrorHandler(
));


      domParser.parse(is);
    }
    catch(Exception e)
    {
      System.out.println(e.getMessage( ));
    }
 
Where JarErrorHandler is my Error Handler which
simeply prints the specified Error Messages.

The relevent portion of ForImport.xml is:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ex SYSTEM "C:/jason.dtd">

The file jason.dtd does exist at C:/jason.dtd on my
local system.  When I run the program I get the
following output:

In fatalErrer( )
Stopping after fatal error: File "C:/jason.dtd" not
found.

I'm sure the problem is something silly, but I can't
figure it out!  Any help would be greatly appreciated.

-Jason

__________________________________________________
Do You Yahoo!?
Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
http://geocities.yahoo.com/ps/info1

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to