1 /* 2 * reserved comment block 3 * DO NOT REMOVE OR ALTER! 4 */ 5 /* 6 * Licensed to the Apache Software Foundation (ASF) under one or more 7 * contributor license agreements. See the NOTICE file distributed with 8 * this work for additional information regarding copyright ownership. 9 * The ASF licenses this file to You under the Apache License, Version 2.0 10 * (the "License"); you may not use this file except in compliance with 11 * the License. You may obtain a copy of the License at 12 * 13 * http://www.apache.org/licenses/LICENSE-2.0 14 * 15 * Unless required by applicable law or agreed to in writing, software 16 * distributed under the License is distributed on an "AS IS" BASIS, 17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 * See the License for the specific language governing permissions and 19 * limitations under the License. 20 */ 21 22 23 package com.sun.org.apache.xml.internal.serialize; 24 25 26 import java.io.OutputStream; 27 import java.io.Writer; 28 29 30 /** 31 * Implements an XHTML serializer supporting both DOM and SAX 32 * pretty serializing. For usage instructions see either {@link 33 * Serializer} or {@link BaseMarkupSerializer}. 34 * 35 * @deprecated This class was deprecated in Xerces 2.6.2. It is 36 * recommended that new applications use JAXP's Transformation API 37 * for XML (TrAX) for serializing XHTML. See the Xerces documentation 38 * for more information. 39 * @author <a href="mailto:arkin@intalio.com">Assaf Arkin</a> 40 * @see Serializer 41 */ 42 public class XHTMLSerializer 43 extends HTMLSerializer 44 { 45 46 47 /** 48 * Constructs a new serializer. The serializer cannot be used without 49 * calling {@link #setOutputCharStream} or {@link #setOutputByteStream} 50 * first. 51 */ 52 public XHTMLSerializer() 53 { 54 super( true, new OutputFormat( Method.XHTML, null, false ) ); 55 } 56 57 58 /** 59 * Constructs a new serializer. The serializer cannot be used without 60 * calling {@link #setOutputCharStream} or {@link #setOutputByteStream} 61 * first. 62 */ 63 public XHTMLSerializer( OutputFormat format ) 64 { 65 super( true, format != null ? format : new OutputFormat( Method.XHTML, null, false ) ); 66 } 67 68 69 /** 70 * Constructs a new serializer that writes to the specified writer 71 * using the specified output format. If <tt>format</tt> is null, 72 * will use a default output format. 73 * 74 * @param writer The writer to use 75 * @param format The output format to use, null for the default 76 */ 77 public XHTMLSerializer( Writer writer, OutputFormat format ) 78 { 79 super( true, format != null ? format : new OutputFormat( Method.XHTML, null, false ) ); 80 setOutputCharStream( writer ); 81 } 82 83 84 /** 85 * Constructs a new serializer that writes to the specified output 86 * stream using the specified output format. If <tt>format</tt> 87 * is null, will use a default output format. 88 * 89 * @param output The output stream to use 90 * @param format The output format to use, null for the default 91 */ 92 public XHTMLSerializer( OutputStream output, OutputFormat format ) 93 { 94 super( true, format != null ? format : new OutputFormat( Method.XHTML, null, false ) ); 95 setOutputByteStream( output ); 96 } 97 98 99 public void setOutputFormat( OutputFormat format ) 100 { 101 super.setOutputFormat( format != null ? format : new OutputFormat( Method.XHTML, null, false ) ); 102 } 103 104 105 }