You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by mo...@apache.org on 2001/10/25 15:13:53 UTC
cvs commit: xml-xalan/java/src/org/apache/xalan/xsltc/compiler Import.java Include.java
morten 01/10/25 06:13:53
Modified: java/src/org/apache/xalan/xsltc/compiler Import.java
Include.java
Log:
A fix for resulving relative URIs when using <xsl:include/> and <xsl:import/>
through TrAX without using a URIResolver.
PR: n/a
Obtained from: n/a
Submitted by: morten@xml.apache.org
Reviewed by: morten@xml.apache.org
Revision Changes Path
1.11 +5 -2 xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Import.java
Index: Import.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Import.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- Import.java 2001/09/24 12:27:39 1.10
+++ Import.java 2001/10/25 13:13:53 1.11
@@ -1,5 +1,5 @@
/*
- * @(#)$Id: Import.java,v 1.10 2001/09/24 12:27:39 morten Exp $
+ * @(#)$Id: Import.java,v 1.11 2001/10/25 13:13:53 morten Exp $
*
* The Apache Software License, Version 1.1
*
@@ -65,6 +65,7 @@
package org.apache.xalan.xsltc.compiler;
+import java.io.File;
import java.net.URL;
import java.net.MalformedURLException;
import java.util.Enumeration;
@@ -97,7 +98,7 @@
return;
}
- final String currLoadedDoc = context.getSystemId();
+ String currLoadedDoc = context.getSystemId();
SourceLoader loader = context.getSourceLoader();
InputSource input = null;
@@ -106,6 +107,8 @@
input = loader.loadSource(docToLoad, currLoadedDoc, xsltc);
}
else {
+ File file = new File(currLoadedDoc);
+ if (file.exists()) currLoadedDoc = "file:"+currLoadedDoc;
final URL url = new URL(new URL(currLoadedDoc), docToLoad);
docToLoad = url.toString();
input = new InputSource(docToLoad);
1.10 +5 -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.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- Include.java 2001/10/19 11:58:40 1.9
+++ Include.java 2001/10/25 13:13:53 1.10
@@ -1,5 +1,5 @@
/*
- * @(#)$Id: Include.java,v 1.9 2001/10/19 11:58:40 morten Exp $
+ * @(#)$Id: Include.java,v 1.10 2001/10/25 13:13:53 morten Exp $
*
* The Apache Software License, Version 1.1
*
@@ -64,6 +64,7 @@
package org.apache.xalan.xsltc.compiler;
+import java.io.File;
import java.net.URL;
import java.net.MalformedURLException;
import java.util.Enumeration;
@@ -96,7 +97,7 @@
return;
}
- final String currLoadedDoc = context.getSystemId();
+ String currLoadedDoc = context.getSystemId();
SourceLoader loader = context.getSourceLoader();
InputSource input = null;
@@ -105,6 +106,8 @@
input = loader.loadSource(docToLoad, currLoadedDoc, xsltc);
}
else {
+ File file = new File(currLoadedDoc);
+ if (file.exists()) currLoadedDoc = "file:"+currLoadedDoc;
final URL url = new URL(new URL(currLoadedDoc), docToLoad);
docToLoad = url.toString();
input = new InputSource(docToLoad);
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org