You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by dl...@locus.apache.org on 2000/12/15 18:33:51 UTC
cvs commit: xml-xalan/java/samples/servlet ApplyXSLT.java DefaultApplyXSLTProperties.java
dleslie 00/12/15 09:33:45
Modified: java/samples/servlet ApplyXSLT.java
DefaultApplyXSLTProperties.java
Log:
1. Don;t need to set system properties.
2.getContentType() can now be restored to its previous form;
OutputProperties.getProperty(OutputKeys.MEDIA_TYPE) has
been fixed. It no longer returns a value if the stylesheet does
not have a media attribute.
Revision Changes Path
1.15 +22 -11 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.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- ApplyXSLT.java 2000/12/08 20:33:30 1.14
+++ ApplyXSLT.java 2000/12/15 17:33:41 1.15
@@ -1,5 +1,5 @@
/*****************************************************************************************************
- * $Id: ApplyXSLT.java,v 1.14 2000/12/08 20:33:30 dleslie Exp $
+ * $Id: ApplyXSLT.java,v 1.15 2000/12/15 17:33:41 dleslie Exp $
*
* Copyright (c) 1998-1999 Lotus Corporation, Inc. All Rights Reserved.
* This software is provided without a warranty of any kind.
@@ -37,6 +37,7 @@
import org.apache.xalan.stree.SourceTreeHandler;
import org.apache.xpath.objects.XObject;
import org.apache.xpath.objects.XString;
+import org.apache.xalan.processor.*;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
@@ -476,16 +477,26 @@
public String getContentType(Templates templates)
{
Properties oprops = templates.getOutputProperties();
-// 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";
- }
+ 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";
+ }
+ }
+
/**
* Defines and sets select top-level XSL stylesheet variables from the HTTP request, which
1.9 +3 -3 xml-xalan/java/samples/servlet/DefaultApplyXSLTProperties.java
Index: DefaultApplyXSLTProperties.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/samples/servlet/DefaultApplyXSLTProperties.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- DefaultApplyXSLTProperties.java 2000/12/15 17:21:20 1.8
+++ DefaultApplyXSLTProperties.java 2000/12/15 17:33:41 1.9
@@ -1,5 +1,5 @@
/*****************************************************************************************************
- * $Id: DefaultApplyXSLTProperties.java,v 1.8 2000/12/15 17:21:20 dleslie Exp $
+ * $Id: DefaultApplyXSLTProperties.java,v 1.9 2000/12/15 17:33:41 dleslie Exp $
*
* Copyright (c) 1998-1999 Lotus Corporation, Inc. All Rights Reserved.
* This software is provided without a warranty of any kind.
@@ -54,7 +54,7 @@
super();
DEFAULT_catalog = null;
setLocalHost();
- setSystemProperties();
+ // setSystemProperties();
}
/**
@@ -233,7 +233,7 @@
}
/**
- * Sets required system properties.
+ * I think we no longer need this. Sets the 3 jaxp core system properties.
*/
protected void setSystemProperties()
{