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/11/16 17:51:11 UTC
cvs commit: xml-xalan/java/samples/servlet ApplyXSLT.java ApplyXSLTListener.java
dleslie 00/11/16 08:51:11
Modified: java/samples/servlet ApplyXSLT.java ApplyXSLTListener.java
Log:
1. Fixed ApplyXSLTListener constructor to match DefaultErrorHandler.
2. Use default OutputFormatExtended if get null from stylesheet.
Revision Changes Path
1.11 +15 -13 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.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- ApplyXSLT.java 2000/11/10 15:59:42 1.10
+++ ApplyXSLT.java 2000/11/16 16:51:10 1.11
@@ -1,5 +1,5 @@
/*****************************************************************************************************
- * $Id: ApplyXSLT.java,v 1.10 2000/11/10 15:59:42 dleslie Exp $
+ * $Id: ApplyXSLT.java,v 1.11 2000/11/16 16:51:10 dleslie Exp $
*
* Copyright (c) 1998-1999 Lotus Corporation, Inc. All Rights Reserved.
* This software is provided without a warranty of any kind.
@@ -235,7 +235,7 @@
time = System.currentTimeMillis();
// Listener to be used for all reporting
- ApplyXSLTListener listener = new ApplyXSLTListener("ApplyXSLT");
+ ApplyXSLTListener listener = new ApplyXSLTListener();
listener.out.println("debug is " + debug);
StreamSource xmlSource = null;
@@ -291,20 +291,20 @@
try
{
String contentType = null;
- contentType = getContentType(templates);
+ contentType = getContentType(templates);
if (contentType != null);
response.setContentType(contentType);
- if (transformer instanceof TransformerImpl)
- {
- TransformerImpl transformerImpl = (TransformerImpl)transformer;
+ if (transformer instanceof TransformerImpl)
+ {
+ TransformerImpl transformerImpl = (TransformerImpl)transformer;
transformerImpl.setQuietConflictWarnings(ourDefaultParameters.isNoCW(request));
- }
+ }
- setStylesheetParams(transformer, request);
- transformer.transform(xmlSource, new StreamResult(response.getOutputStream()));
+ setStylesheetParams(transformer, request);
+ transformer.transform(xmlSource, new StreamResult(response.getOutputStream()));
- if (debug)
+ if (debug)
writeLog(listener.getMessage(), response.SC_OK);
}
catch (Exception exc)
@@ -313,8 +313,8 @@
("Exception occurred during Transformation:"
+ EOL + listener.getMessage() + EOL
+ exc.getMessage(),
- exc,
- response.SC_INTERNAL_SERVER_ERROR);
+ exc,
+ response.SC_INTERNAL_SERVER_ERROR);
if (debug) writeLog(axe);
displayException(response, axe, debug);
}
@@ -330,7 +330,7 @@
("Exception occurred during ctor/Transformation:"
+ EOL + listener.getMessage() + EOL
+ saxExc.getMessage(),
- saxExc,
+ saxExc,
response.SC_INTERNAL_SERVER_ERROR);
if (debug) writeLog(axe);
displayException(response, axe, debug);
@@ -477,6 +477,8 @@
{
StylesheetRoot xslSourceRoot = (StylesheetRoot)templates;
OutputFormatExtended of = xslSourceRoot.getOutput();
+ if (null==of)
+ of = new OutputFormatExtended();
String encoding = of.getEncoding();
String media = of.getMediaType();
if (media != null)
1.3 +3 -4 xml-xalan/java/samples/servlet/ApplyXSLTListener.java
Index: ApplyXSLTListener.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/samples/servlet/ApplyXSLTListener.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ApplyXSLTListener.java 2000/08/09 14:01:13 1.2
+++ ApplyXSLTListener.java 2000/11/16 16:51:10 1.3
@@ -1,5 +1,5 @@
/*****************************************************************************************************
- * $Id: ApplyXSLTListener.java,v 1.2 2000/08/09 14:01:13 dleslie Exp $
+ * $Id: ApplyXSLTListener.java,v 1.3 2000/11/16 16:51:10 dleslie Exp $
*
* Copyright (c) 1998-1999 Lotus Corporation, Inc. All Rights Reserved.
* This software is provided without a warranty of any kind.
@@ -39,10 +39,9 @@
/**
* Constructor.
*/
- public ApplyXSLTListener(String identifier)
+ public ApplyXSLTListener()
{
- super(identifier);
- out = new PrintWriter(new BufferedOutputStream(outStream), true);
+ out = new PrintWriter(new BufferedOutputStream(outStream), true);
}
/**