You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by tm...@apache.org on 2002/06/15 01:12:29 UTC
cvs commit: xml-xalan/java/src/org/apache/xalan/xsltc/compiler Include.java
tmiller 2002/06/14 16:12:29
Modified: java/src/org/apache/xalan/xsltc/compiler Tag:
jaxp-ri-1_2_0-fcs-branch Include.java
Log:
catching file not found exception
Revision Changes Path
No revision
No revision
1.13.4.2 +19 -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.13.4.1
retrieving revision 1.13.4.2
diff -u -r1.13.4.1 -r1.13.4.2
--- Include.java 16 Apr 2002 17:39:19 -0000 1.13.4.1
+++ Include.java 14 Jun 2002 23:12:29 -0000 1.13.4.2
@@ -89,8 +89,9 @@
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);
@@ -162,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: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org