greenrd 00/12/11 03:33:24
Modified: . changes.xml
src/org/apache/cocoon/processor/xsp/library/java util.xsl
src/org/apache/cocoon/processor/xsp XSPUtil.java
Log:
encoding support for including non-xml files
Revision Changes Path
1.163 +5 -1 xml-cocoon/changes.xml
Index: changes.xml
===================================================================
RCS file: /home/cvs/xml-cocoon/changes.xml,v
retrieving revision 1.162
retrieving revision 1.163
diff -u -r1.162 -r1.163
--- changes.xml 2000/12/10 18:30:07 1.162
+++ changes.xml 2000/12/11 11:33:19 1.163
@@ -4,7 +4,7 @@
<!--
History of Cocoon changes
- $Id: changes.xml,v 1.162 2000/12/10 18:30:07 greenrd Exp $
+ $Id: changes.xml,v 1.163 2000/12/11 11:33:19 greenrd Exp $
-->
<changes title="History of Changes">
@@ -18,6 +18,10 @@
</devs>
<release version="@version@" date="@date@">
+ <action dev="RDG" type="add">
+ Added encoding support to util:get-file-contents and various similar
+ XSPUtil methods
+ </action>
<action dev="RDG" type="fix" due-to="Gerard Maas"
due-to-email="[EMAIL PROTECTED]">
Fixed xsp:pi to add PI before document element instead of after.
1.21 +1 -1
xml-cocoon/src/org/apache/cocoon/processor/xsp/library/java/util.xsl
Index: util.xsl
===================================================================
RCS file:
/home/cvs/xml-cocoon/src/org/apache/cocoon/processor/xsp/library/java/util.xsl,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- util.xsl 2000/11/20 18:04:40 1.20
+++ util.xsl 2000/12/11 11:33:22 1.21
@@ -224,7 +224,7 @@
String.valueOf(<xsl:copy-of select="$name"/>),
request,
(ServletContext) context
- )
+ ), "<xsl:value-of select="@encoding"/>"
)
</xsp:expr>
</xsl:template>
1.18 +14 -2
xml-cocoon/src/org/apache/cocoon/processor/xsp/XSPUtil.java
Index: XSPUtil.java
===================================================================
RCS file:
/home/cvs/xml-cocoon/src/org/apache/cocoon/processor/xsp/XSPUtil.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- XSPUtil.java 2000/10/22 13:32:34 1.17
+++ XSPUtil.java 2000/12/11 11:33:23 1.18
@@ -1,4 +1,4 @@
-/*-- $Id: XSPUtil.java,v 1.17 2000/10/22 13:32:34 greenrd Exp $ --
+/*-- $Id: XSPUtil.java,v 1.18 2000/12/11 11:33:23 greenrd Exp $ --
============================================================================
The Apache Software License, Version 1.1
@@ -62,7 +62,7 @@
/**
* @author <a href="mailto:[EMAIL PROTECTED]">Ricardo Rocha</a>
- * @version $Revision: 1.17 $ $Date: 2000/10/22 13:32:34 $
+ * @version $Revision: 1.18 $ $Date: 2000/12/11 11:33:23 $
*/
public class XSPUtil {
public static String pathComponent(String filename) {
@@ -397,8 +397,20 @@
return getContents(new URL(url).openStream());
}
+ public static String getURLContents(String url, String encoding) throws
IOException {
+ return getContents(new URL(url).openStream(), encoding);
+ }
+
public static String getFileContents(String filename) throws IOException {
return getContents(new FileReader(filename));
+ }
+
+ public static String getFileContents(String filename, String encoding)
throws IOException {
+ return getContents(new FileInputStream(filename), encoding);
+ }
+
+ public static String getContents(InputStream in, String encoding) throws
IOException {
+ return getContents(new InputStreamReader(in, encoding));
}
public static String getContents(InputStream in) throws IOException {