dleslie 00/12/08 12:33:32
Modified: java/samples/servlet ApplyXSLT.java
Log:
Modified getContentType)( to pay attention to the output method
property, not to media or encoding. This appears to work. The
other always returned text/xml, even if the output method is html.
Revision Changes Path
1.14 +10 -19 xml-xalan/java/samples/servlet/ApplyXSLT.java
Index: ApplyXSLT.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/samples/servlet/ApplyXSLT.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- ApplyXSLT.java 2000/12/08 18:48:22 1.13
+++ ApplyXSLT.java 2000/12/08 20:33:30 1.14
@@ -1,5 +1,5 @@
/*****************************************************************************************************
- * $Id: ApplyXSLT.java,v 1.13 2000/12/08 18:48:22 dleslie Exp $
+ * $Id: ApplyXSLT.java,v 1.14 2000/12/08 20:33:30 dleslie Exp $
*
* Copyright (c) 1998-1999 Lotus Corporation, Inc. All Rights Reserved.
* This software is provided without a warranty of
any kind.
@@ -476,24 +476,15 @@
public String getContentType(Templates templates)
{
Properties oprops = templates.getOutputProperties();
- String encoding = oprops.getProperty(OutputKeys.ENCODING);
- String media = oprops.getProperty(OutputKeys.MEDIA_TYPE);
- if (media != null)
- {
- if (encoding != null)
- return media + "; charset=" + encoding;
- return media;
- }
- else
- {
- String method = oprops.getProperty(OutputKeys.METHOD);
- if (method.equals("html"))
- return "text/html";
- else if (method.equals("text"))
- return "text/plain";
- else
- return "text/xml";
- }
+// String encoding = oprops.getProperty(OutputKeys.ENCODING);
+// String media = oprops.getProperty(OutputKeys.MEDIA_TYPE);
+ String method = oprops.getProperty(OutputKeys.METHOD);
+ if (method.equals("html"))
+ return "text/html";
+ else if (method.equals("text"))
+ return "text/plain";
+ else
+ return "text/xml";
}
/**