costin 01/05/03 16:00:26
Modified: java/src/javax/xml/transform/stream StreamResult.java
StreamSource.java
Log:
Small fix to avoid file:////path that may fail on some JDK.
Revision Changes Path
1.8 +6 -2
xml-xalan/java/src/javax/xml/transform/stream/StreamResult.java
Index: StreamResult.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/javax/xml/transform/stream/StreamResult.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- StreamResult.java 2000/12/20 04:55:31 1.7
+++ StreamResult.java 2001/05/03 23:00:24 1.8
@@ -55,7 +55,7 @@
* <http://www.apache.org/>.
*/
/**
- * $Id: StreamResult.java,v 1.7 2000/12/20 04:55:31 sboag Exp $
+ * $Id: StreamResult.java,v 1.8 2001/05/03 23:00:24 costin Exp $
*/
package javax.xml.transform.stream;
@@ -196,7 +196,11 @@
* @param f Must a non-null File reference.
*/
public void setSystemId(File f) {
- this.systemId = "file:///" + f.getAbsolutePath();
+ String fpath=f.getAbsolutePath();
+ if( fpath.startsWith("/"))
+ this.systemId= "file://" + fpath;
+ else
+ this.systemId = "file:///" + fpath;
}
/**
1.8 +7 -3
xml-xalan/java/src/javax/xml/transform/stream/StreamSource.java
Index: StreamSource.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/javax/xml/transform/stream/StreamSource.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- StreamSource.java 2000/12/20 04:55:31 1.7
+++ StreamSource.java 2001/05/03 23:00:25 1.8
@@ -55,7 +55,7 @@
* <http://www.apache.org/>.
*/
/**
- * $Id: StreamSource.java,v 1.7 2000/12/20 04:55:31 sboag Exp $
+ * $Id: StreamSource.java,v 1.8 2001/05/03 23:00:25 costin Exp $
*/
package javax.xml.transform.stream;
@@ -168,7 +168,7 @@
* @param f Must a non-null File reference.
*/
public StreamSource(File f) {
- this.systemId = "file:///" + f.getAbsolutePath();
+ setSystemId(f);
}
/**
@@ -276,7 +276,11 @@
* @param f Must a non-null File reference.
*/
public void setSystemId(File f) {
- this.systemId = "file:///" + f.toString();
+ String fpath=f.getAbsolutePath();
+ if( fpath.startsWith("/"))
+ this.systemId= "file://" + fpath;
+ else
+ this.systemId = "file:///" + fpath;
}
//////////////////////////////////////////////////////////////////////
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]