Home | History | Annotate | Download | only in transform
      1 /*
      2  * Licensed to the Apache Software Foundation (ASF) under one or more
      3  * contributor license agreements.  See the NOTICE file distributed with
      4  * this work for additional information regarding copyright ownership.
      5  * The ASF licenses this file to You under the Apache License, Version 2.0
      6  * (the "License"); you may not use this file except in compliance with
      7  * the License.  You may obtain a copy of the License at
      8  *
      9  *     http://www.apache.org/licenses/LICENSE-2.0
     10  *
     11  * Unless required by applicable law or agreed to in writing, software
     12  * distributed under the License is distributed on an "AS IS" BASIS,
     13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     14  * See the License for the specific language governing permissions and
     15  * limitations under the License.
     16  */
     17 
     18 // $Id: OutputKeys.java 569994 2007-08-27 04:28:57Z mrglavas $
     19 
     20 package javax.xml.transform;
     21 
     22 /**
     23  * Provides string constants that can be used to set
     24  * output properties for a Transformer, or to retrieve
     25  * output properties from a Transformer or Templates object.
     26  * <p>All the fields in this class are read-only.</p>
     27  *
     28  * @see <a href="http://www.w3.org/TR/xslt#output">
     29  *  section 16 of the XSL Transformations (XSLT) W3C Recommendation</a>
     30  */
     31 public class OutputKeys {
     32 
     33     /**
     34      * Default constructor is private on purpose.  This class is
     35      * only for static variable access, and should never be constructed.
     36      */
     37     private OutputKeys() { }
     38 
     39     /**
     40      * method = "xml" | "html" | "text" | <var>expanded name</var>.
     41      *
     42      * <p>The value of the method property identifies the overall method that
     43      * should be used for outputting the result tree.  Other non-namespaced
     44      * values may be used, such as "xhtml", but, if accepted, the handling
     45      * of such values is implementation defined.  If any of the method values
     46      * are not accepted and are not namespace qualified,
     47      * then {@link javax.xml.transform.Transformer#setOutputProperty}
     48      * or {@link javax.xml.transform.Transformer#setOutputProperties} will
     49      * throw a {@link java.lang.IllegalArgumentException}.</p>
     50      *
     51      * @see <a href="http://www.w3.org/TR/xslt#output">
     52      *  section 16 of the XSL Transformations (XSLT) W3C Recommendation</a>
     53      */
     54     public static final String METHOD = "method";
     55 
     56     /**
     57      * version = <var>nmtoken</var>.
     58      *
     59      * <p><code>version</code> specifies the version of the output
     60      * method.</p>
     61      * <p>When the output method is "xml", the version value specifies the
     62      * version of XML to be used for outputting the result tree. The default
     63      * value for the xml output method is 1.0. When the output method is
     64      * "html", the version value indicates the version of the HTML.
     65      * The default value for the xml output method is 4.0, which specifies
     66      * that the result should be output as HTML conforming to the HTML 4.0
     67      * Recommendation [HTML].  If the output method is "text", the version
     68      * property is ignored.</p>
     69      * @see <a href="http://www.w3.org/TR/xslt#output">
     70      *  section 16 of the XSL Transformations (XSLT) W3C Recommendation</a>
     71      */
     72     public static final String VERSION = "version";
     73 
     74     /**
     75      * encoding = <var>string</var>.
     76      *
     77      * <p><code>encoding</code> specifies the preferred character
     78      * encoding that the Transformer should use to encode sequences of
     79      * characters as sequences of bytes. The value of the encoding property should be
     80      * treated case-insensitively. The value must only contain characters in
     81      * the range #x21 to #x7E (i.e., printable ASCII characters). The value
     82      * should either be a <code>charset</code> registered with the Internet
     83      * Assigned Numbers Authority <a href="#IANA">[IANA]</a>,
     84      * <a href="#RFC2278">[RFC2278]</a> or start with <code>X-</code>.</p>
     85      * @see <a href="http://www.w3.org/TR/xslt#output">
     86      * section 16 of the XSL Transformations (XSLT) W3C Recommendation</a>
     87      */
     88     public static final String ENCODING = "encoding";
     89 
     90     /**
     91      * omit-xml-declaration = "yes" | "no".
     92      *
     93      * <p><code>omit-xml-declaration</code> specifies whether the XSLT
     94      * processor should output an XML declaration; the value must be
     95      * <code>yes</code> or <code>no</code>.</p>
     96      * @see <a href="http://www.w3.org/TR/xslt#output">
     97      *  section 16 of the XSL Transformations (XSLT) W3C Recommendation</a>
     98      */
     99     public static final String OMIT_XML_DECLARATION = "omit-xml-declaration";
    100 
    101     /**
    102      * standalone = "yes" | "no".
    103      *
    104      * <p><code>standalone</code> specifies whether the Transformer
    105      * should output a standalone document declaration; the value must be
    106      * <code>yes</code> or <code>no</code>.</p>
    107      * @see <a href="http://www.w3.org/TR/xslt#output">
    108      *  section 16 of the XSL Transformations (XSLT) W3C Recommendation</a>
    109      */
    110     public static final String STANDALONE = "standalone";
    111 
    112     /**
    113      * doctype-public = <var>string</var>.
    114      * <p>See the documentation for the {@link #DOCTYPE_SYSTEM} property
    115      * for a description of what the value of the key should be.</p>
    116      *
    117      * @see <a href="http://www.w3.org/TR/xslt#output">
    118      *  section 16 of the XSL Transformations (XSLT) W3C Recommendation</a>
    119      */
    120     public static final String DOCTYPE_PUBLIC = "doctype-public";
    121 
    122     /**
    123      * doctype-system = <var>string</var>.
    124      * <p><code>doctype-system</code> specifies the system identifier
    125      * to be used in the document type declaration.</p>
    126      * <p>If the doctype-system property is specified, the xml output method
    127      * should output a document type declaration immediately before the first
    128      * element. The name following &lt;!DOCTYPE should be the name of the first
    129      * element. If doctype-public property is also specified, then the xml
    130      * output method should output PUBLIC followed by the public identifier
    131      * and then the system identifier; otherwise, it should output SYSTEM
    132      * followed by the system identifier. The internal subset should be empty.
    133      * The value of the doctype-public property should be ignored unless the doctype-system
    134      * property is specified.</p>
    135      * <p>If the doctype-public or doctype-system properties are specified,
    136      * then the html output method should output a document type declaration
    137      * immediately before the first element. The name following &lt;!DOCTYPE
    138      * should be HTML or html. If the doctype-public property is specified,
    139      * then the output method should output PUBLIC followed by the specified
    140      * public identifier; if the doctype-system property is also specified,
    141      * it should also output the specified system identifier following the
    142      * public identifier. If the doctype-system property is specified but
    143      * the doctype-public property is not specified, then the output method
    144      * should output SYSTEM followed by the specified system identifier.</p>
    145      *
    146      * <p><code>doctype-system</code> specifies the system identifier
    147      * to be used in the document type declaration.</p>
    148      * @see <a href="http://www.w3.org/TR/xslt#output">
    149      *  section 16 of the XSL Transformations (XSLT) W3C Recommendation</a>
    150      */
    151     public static final String DOCTYPE_SYSTEM = "doctype-system";
    152 
    153     /**
    154      * cdata-section-elements = <var>expanded names</var>.
    155      *
    156      * <p><code>cdata-section-elements</code> specifies a whitespace delimited
    157      * list of the names of elements whose text node children should be output
    158      * using CDATA sections. Note that these names must use the format
    159      * described in the section Qualfied Name Representation in
    160      * {@link javax.xml.transform}.</p>
    161      *
    162      * @see <a href="http://www.w3.org/TR/xslt#output">
    163      *  section 16 of the XSL Transformations (XSLT) W3C Recommendation.</a>
    164      */
    165     public static final String CDATA_SECTION_ELEMENTS =
    166         "cdata-section-elements";
    167 
    168     /**
    169      * indent = "yes" | "no".
    170      *
    171      * <p><code>indent</code> specifies whether the Transformer may
    172      * add additional whitespace when outputting the result tree; the value
    173      * must be <code>yes</code> or <code>no</code>.  </p>
    174      * @see <a href="http://www.w3.org/TR/xslt#output">
    175      *  section 16 of the XSL Transformations (XSLT) W3C Recommendation</a>
    176      */
    177     public static final String INDENT = "indent";
    178 
    179     /**
    180      * media-type = <var>string</var>.
    181      *
    182      * <p><code>media-type</code> specifies the media type (MIME
    183      * content type) of the data that results from outputting the result
    184      * tree. The <code>charset</code> parameter should not be specified
    185      * explicitly; instead, when the top-level media type is
    186      * <code>text</code>, a <code>charset</code> parameter should be added
    187      * according to the character encoding actually used by the output
    188      * method.  </p>
    189      * @see <a href="http://www.w3.org/TR/xslt#output">
    190      *  section 16 of the XSL Transformations (XSLT) W3C Recommendation</a>
    191      */
    192     public static final String MEDIA_TYPE = "media-type";
    193 }
    194