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