cziegeler 2002/12/03 05:30:34 Modified: src/java/org/apache/cocoon/serialization XMLSerializer.java HTMLSerializer.java TextSerializer.java AbstractTextSerializer.java Log: Hopefully fixing bug 11935 "format properties for Text/XMLSerializer not working " Revision Changes Path 1.9 +14 -3 xml-cocoon2/src/java/org/apache/cocoon/serialization/XMLSerializer.java Index: XMLSerializer.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/serialization/XMLSerializer.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- XMLSerializer.java 27 Nov 2002 23:58:10 -0000 1.8 +++ XMLSerializer.java 3 Dec 2002 13:30:34 -0000 1.9 @@ -53,6 +53,9 @@ import javax.xml.transform.OutputKeys; import javax.xml.transform.sax.TransformerHandler; import javax.xml.transform.stream.StreamResult; + +import org.apache.avalon.framework.configuration.Configuration; +import org.apache.avalon.framework.configuration.ConfigurationException; import org.apache.cocoon.CascadingIOException; import java.io.IOException; @@ -70,13 +73,21 @@ public XMLSerializer() { } + /** + * Set the configurations for this serializer. + */ + public void configure(Configuration conf) + throws ConfigurationException { + super.configure( conf ); + this.format.put(OutputKeys.METHOD,"xml"); + } + public void setOutputStream(OutputStream out) throws IOException { try { super.setOutputStream(out); this.handler = this.getTransformerHandler(); - format.put(OutputKeys.METHOD,"xml"); - handler.setResult(new StreamResult(this.output)); handler.getTransformer().setOutputProperties(format); + handler.setResult(new StreamResult(this.output)); this.setContentHandler(handler); this.setLexicalHandler(handler); } catch (Exception e) { 1.11 +2 -2 xml-cocoon2/src/java/org/apache/cocoon/serialization/HTMLSerializer.java Index: HTMLSerializer.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/serialization/HTMLSerializer.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- HTMLSerializer.java 13 Sep 2002 07:30:50 -0000 1.10 +++ HTMLSerializer.java 3 Dec 2002 13:30:34 -0000 1.11 @@ -91,8 +91,8 @@ try { super.setOutputStream(out); TransformerHandler handler = this.getTransformerHandler(); - handler.getTransformer().setOutputProperties(this.format); handler.setResult(new StreamResult(this.output)); + handler.getTransformer().setOutputProperties(this.format); this.setContentHandler(handler); this.setLexicalHandler(handler); } catch (Exception e) { 1.9 +14 -3 xml-cocoon2/src/java/org/apache/cocoon/serialization/TextSerializer.java Index: TextSerializer.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/serialization/TextSerializer.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- TextSerializer.java 27 Nov 2002 23:58:10 -0000 1.8 +++ TextSerializer.java 3 Dec 2002 13:30:34 -0000 1.9 @@ -53,6 +53,9 @@ import javax.xml.transform.OutputKeys; import javax.xml.transform.sax.TransformerHandler; import javax.xml.transform.stream.StreamResult; + +import org.apache.avalon.framework.configuration.Configuration; +import org.apache.avalon.framework.configuration.ConfigurationException; import org.apache.cocoon.CascadingIOException; import java.io.IOException; @@ -71,13 +74,21 @@ public TextSerializer() { } + /** + * Set the configurations for this serializer. + */ + public void configure(Configuration conf) + throws ConfigurationException { + super.configure( conf ); + this.format.put(OutputKeys.METHOD,"text"); + } + public void setOutputStream(OutputStream out) throws IOException { try { super.setOutputStream(out); handler = this.getTransformerHandler(); - format.put(OutputKeys.METHOD,"text"); - handler.setResult(new StreamResult(this.output)); handler.getTransformer().setOutputProperties(format); + handler.setResult(new StreamResult(this.output)); this.setContentHandler(handler); this.setLexicalHandler(handler); } catch (Exception e) { 1.17 +2 -2 xml-cocoon2/src/java/org/apache/cocoon/serialization/AbstractTextSerializer.java Index: AbstractTextSerializer.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/serialization/AbstractTextSerializer.java,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- AbstractTextSerializer.java 12 Sep 2002 14:14:36 -0000 1.16 +++ AbstractTextSerializer.java 3 Dec 2002 13:30:34 -0000 1.17 @@ -334,8 +334,8 @@ TransformerHandler handler = this.getTransformerHandler(); - handler.setResult(new StreamResult(writer)); handler.getTransformer().setOutputProperties(format); + handler.setResult(new StreamResult(writer)); // Output a single element handler.startDocument();
---------------------------------------------------------------------- In case of troubles, e-mail: [EMAIL PROTECTED] To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]