tmiller     2002/06/18 04:17:15

  Modified:    java/src/org/apache/xalan/xsltc/compiler Include.java
  Log:
  catching file not found exception fixed
  
  Revision  Changes    Path
  1.17      +18 -2     
xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Include.java
  
  Index: Include.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Include.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- Include.java      3 May 2002 14:20:25 -0000       1.16
  +++ Include.java      18 Jun 2002 11:17:15 -0000      1.17
  @@ -89,8 +89,8 @@
   
       public void parseContents(final Parser parser) {
        final Stylesheet context = parser.getCurrentStylesheet();
  +     String docToLoad = getAttribute("href");
        try {
  -         String docToLoad = getAttribute("href");
            if (context.checkForLoop(docToLoad)) {
                final int errno = ErrorMsg.CIRCULAR_INCLUDE_ERR;
                final ErrorMsg msg = new ErrorMsg(errno, docToLoad, this);
  @@ -163,6 +163,22 @@
                        topStylesheet.addElement((TopLevelElement)element);
                }
            }
  +     }
  +     catch (FileNotFoundException e) {
  +         // Update systemId in parent stylesheet for error reporting
  +         context.setSystemId(getAttribute("href"));
  +
  +         final ErrorMsg msg = 
  +             new ErrorMsg(ErrorMsg.FILE_NOT_FOUND_ERR, docToLoad, this);
  +         parser.reportError(Constants.FATAL, msg);
  +     }
  +     catch (MalformedURLException e) {
  +         // Update systemId in parent stylesheet for error reporting
  +         context.setSystemId(getAttribute("href"));
  +
  +         final ErrorMsg msg = 
  +             new ErrorMsg(ErrorMsg.FILE_NOT_FOUND_ERR, docToLoad, this);
  +         parser.reportError(Constants.FATAL, msg);
        }
        catch (Exception e) {
            e.printStackTrace();
  
  
  

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

Reply via email to