Path: blob/master/src/java.xml/share/classes/javax/xml/transform/OutputKeys.java
40948 views
/*1* Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package javax.xml.transform;2627/**28* Provides string constants that can be used to set29* output properties for a Transformer, or to retrieve30* output properties from a Transformer or Templates object.31* <p>All the fields in this class are read-only.</p>32*33* @see <a href="http://www.w3.org/TR/xslt#output">34* section 16 of the XSL Transformations (XSLT) W3C Recommendation</a>35* @since 1.436*/37public class OutputKeys {3839/**40* Default constructor is private on purpose. This class is41* only for static variable access, and should never be constructed.42*/43private OutputKeys() { }4445/**46* method = "xml" | "html" | "text" | <var>expanded name</var>.47*48* <p>The value of the method property identifies the overall method that49* should be used for outputting the result tree. Other non-namespaced50* values may be used, such as "xhtml", but, if accepted, the handling51* of such values is implementation defined. If any of the method values52* are not accepted and are not namespace qualified,53* then {@link javax.xml.transform.Transformer#setOutputProperty}54* or {@link javax.xml.transform.Transformer#setOutputProperties} will55* throw a {@link java.lang.IllegalArgumentException}.</p>56*57* @see <a href="http://www.w3.org/TR/xslt#output">58* section 16 of the XSL Transformations (XSLT) W3C Recommendation</a>59*/60public static final String METHOD = "method";6162/**63* version = <var>nmtoken</var>.64*65* <p><code>version</code> specifies the version of the output66* method.</p>67* <p>When the output method is "xml", the version value specifies the68* version of XML to be used for outputting the result tree. The default69* value for the xml output method is 1.0. When the output method is70* "html", the version value indicates the version of the HTML.71* The default value for the xml output method is 4.0, which specifies72* that the result should be output as HTML conforming to the HTML 4.073* Recommendation [HTML]. If the output method is "text", the version74* property is ignored.</p>75* @see <a href="http://www.w3.org/TR/xslt#output">76* section 16 of the XSL Transformations (XSLT) W3C Recommendation</a>77*/78public static final String VERSION = "version";7980/**81* encoding = <var>string</var>.82*83* <p><code>encoding</code> specifies the preferred character84* encoding that the Transformer should use to encode sequences of85* characters as sequences of bytes. The value of the encoding property should be86* treated case-insensitively. The value must only contain characters in87* the range #x21 to #x7E (i.e., printable ASCII characters). The value88* should either be a <code>charset</code> registered with the Internet89* Assigned Numbers Authority <a href="http://www.iana.org/">[IANA]</a>,90* <a href="http://www.ietf.org/rfc/rfc2278.txt">[RFC2278]</a>91* or start with <code>X-</code>.</p>92* @see <a href="http://www.w3.org/TR/xslt#output">93* section 16 of the XSL Transformations (XSLT) W3C Recommendation</a>94*/95public static final String ENCODING = "encoding";9697/**98* omit-xml-declaration = "yes" | "no".99*100* <p><code>omit-xml-declaration</code> specifies whether the XSLT101* processor should output an XML declaration; the value must be102* <code>yes</code> or <code>no</code>.</p>103* @see <a href="http://www.w3.org/TR/xslt#output">104* section 16 of the XSL Transformations (XSLT) W3C Recommendation</a>105*/106public static final String OMIT_XML_DECLARATION = "omit-xml-declaration";107108/**109* standalone = "yes" | "no".110*111* <p><code>standalone</code> specifies whether the Transformer112* should output a standalone document declaration; the value must be113* <code>yes</code> or <code>no</code>.</p>114* @see <a href="http://www.w3.org/TR/xslt#output">115* section 16 of the XSL Transformations (XSLT) W3C Recommendation</a>116*/117public static final String STANDALONE = "standalone";118119/**120* doctype-public = <var>string</var>.121* <p>See the documentation for the {@link #DOCTYPE_SYSTEM} property122* for a description of what the value of the key should be.</p>123*124* @see <a href="http://www.w3.org/TR/xslt#output">125* section 16 of the XSL Transformations (XSLT) W3C Recommendation</a>126*/127public static final String DOCTYPE_PUBLIC = "doctype-public";128129/**130* doctype-system = <var>string</var>.131* <p><code>doctype-system</code> specifies the system identifier132* to be used in the document type declaration.</p>133* <p>If the doctype-system property is specified, the xml output method134* should output a document type declaration immediately before the first135* element. The name following <!DOCTYPE should be the name of the first136* element. If doctype-public property is also specified, then the xml137* output method should output PUBLIC followed by the public identifier138* and then the system identifier; otherwise, it should output SYSTEM139* followed by the system identifier. The internal subset should be empty.140* The value of the doctype-public property should be ignored unless the doctype-system141* property is specified.</p>142* <p>If the doctype-public or doctype-system properties are specified,143* then the html output method should output a document type declaration144* immediately before the first element. The name following <!DOCTYPE145* should be HTML or html. If the doctype-public property is specified,146* then the output method should output PUBLIC followed by the specified147* public identifier; if the doctype-system property is also specified,148* it should also output the specified system identifier following the149* public identifier. If the doctype-system property is specified but150* the doctype-public property is not specified, then the output method151* should output SYSTEM followed by the specified system identifier.</p>152*153* <p><code>doctype-system</code> specifies the system identifier154* to be used in the document type declaration.</p>155* @see <a href="http://www.w3.org/TR/xslt#output">156* section 16 of the XSL Transformations (XSLT) W3C Recommendation</a>157*/158public static final String DOCTYPE_SYSTEM = "doctype-system";159160/**161* cdata-section-elements = <var>expanded names</var>.162*163* <p><code>cdata-section-elements</code> specifies a whitespace delimited164* list of the names of elements whose text node children should be output165* using CDATA sections. Note that these names must use the format166* described in the section Qualfied Name Representation in167* {@link javax.xml.transform}.</p>168*169* @see <a href="http://www.w3.org/TR/xslt#output">170* section 16 of the XSL Transformations (XSLT) W3C Recommendation.</a>171*/172public static final String CDATA_SECTION_ELEMENTS =173"cdata-section-elements";174175/**176* indent = "yes" | "no".177*178* <p><code>indent</code> specifies whether the Transformer may179* add additional whitespace when outputting the result tree; the value180* must be <code>yes</code> or <code>no</code>. </p>181* @see <a href="http://www.w3.org/TR/xslt#output">182* section 16 of the XSL Transformations (XSLT) W3C Recommendation</a>183*/184public static final String INDENT = "indent";185186/**187* media-type = <var>string</var>.188*189* <p><code>media-type</code> specifies the media type (MIME190* content type) of the data that results from outputting the result191* tree. The <code>charset</code> parameter should not be specified192* explicitly; instead, when the top-level media type is193* <code>text</code>, a <code>charset</code> parameter should be added194* according to the character encoding actually used by the output195* method. </p>196* @see <a href="http://www.w3.org/TR/xslt#output">s197* ection 16 of the XSL Transformations (XSLT) W3C Recommendation</a>198*/199public static final String MEDIA_TYPE = "media-type";200}201202203