santiagopg 2002/06/18 11:14:44
Modified: java/src/org/apache/xalan/xsltc/trax TransformerImpl.java
Log:
Fixed problem in creation of output handler.
Revision Changes Path
1.48 +15 -9
xml-xalan/java/src/org/apache/xalan/xsltc/trax/TransformerImpl.java
Index: TransformerImpl.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/trax/TransformerImpl.java,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -r1.47 -r1.48
--- TransformerImpl.java 17 Jun 2002 19:59:57 -0000 1.47
+++ TransformerImpl.java 18 Jun 2002 18:14:44 -0000 1.48
@@ -115,8 +115,9 @@
implements DOMCache, ErrorListener {
private AbstractTranslet _translet = null;
+ private String _method = null;
private String _encoding = null;
- private ContentHandler _handler = null;
+ private ContentHandler _handler = null;
private ErrorListener _errorListener = this;
private URIResolver _uriResolver = null;
@@ -229,15 +230,17 @@
private TransletOutputHandler getOutputHandler(Result result)
throws TransformerException
{
- // Try to get the encoding from the translet (may not be set)
- _encoding = (_translet._encoding != null) ? _translet._encoding
- : "UTF-8";
+ // Get output method using get() to ignore defaults
+ _method = (String) _properties.get(OutputKeys.METHOD);
+
+ // Get encoding using getProperty() to use defaults
+ _encoding = (String) _properties.getProperty(OutputKeys.ENCODING);
_tohFactory = TransletOutputHandlerFactory.newInstance();
- _tohFactory.setEncoding(
- (String) _properties.getProperty(OutputKeys.ENCODING));
- _tohFactory.setOutputMethod(
- (String) _properties.getProperty(OutputKeys.METHOD));
+ _tohFactory.setEncoding(_encoding);
+ if (_method != null) {
+ _tohFactory.setOutputMethod(_method);
+ }
// Return the content handler for this Result object
try {
@@ -846,6 +849,9 @@
// Note the use of get() instead of getProperty()
String name = (String) names.nextElement();
String value = (String) properties.get(name);
+
+ // Ignore default properties
+ if (value == null) continue;
// Pass property value to translet - override previous setting
if (name.equals(OutputKeys.ENCODING)) {
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]