Path: blob/aarch64-shenandoah-jdk8u272-b10/jaxp/src/javax/xml/transform/OutputKeys.java
32285 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*/36public class OutputKeys {3738/**39* Default constructor is private on purpose. This class is40* only for static variable access, and should never be constructed.41*/42private OutputKeys() { }4344/**45* method = "xml" | "html" | "text" | <var>expanded name</var>.46*47* <p>The value of the method property identifies the overall method that48* should be used for outputting the result tree. Other non-namespaced49* values may be used, such as "xhtml", but, if accepted, the handling50* of such values is implementation defined. If any of the method values51* are not accepted and are not namespace qualified,52* then {@link javax.xml.transform.Transformer#setOutputProperty}53* or {@link javax.xml.transform.Transformer#setOutputProperties} will54* throw a {@link java.lang.IllegalArgumentException}.</p>55*56* @see <a href="http://www.w3.org/TR/xslt#output">57* section 16 of the XSL Transformations (XSLT) W3C Recommendation</a>58*/59public static final String METHOD = "method";6061/**62* version = <var>nmtoken</var>.63*64* <p><code>version</code> specifies the version of the output65* method.</p>66* <p>When the output method is "xml", the version value specifies the67* version of XML to be used for outputting the result tree. The default68* value for the xml output method is 1.0. When the output method is69* "html", the version value indicates the version of the HTML.70* The default value for the xml output method is 4.0, which specifies71* that the result should be output as HTML conforming to the HTML 4.072* Recommendation [HTML]. If the output method is "text", the version73* property is ignored.</p>74* @see <a href="http://www.w3.org/TR/xslt#output">75* section 16 of the XSL Transformations (XSLT) W3C Recommendation</a>76*/77public static final String VERSION = "version";7879/**80* encoding = <var>string</var>.81*82* <p><code>encoding</code> specifies the preferred character83* encoding that the Transformer should use to encode sequences of84* characters as sequences of bytes. The value of the encoding property should be85* treated case-insensitively. The value must only contain characters in86* the range #x21 to #x7E (i.e., printable ASCII characters). The value87* should either be a <code>charset</code> registered with the Internet88* Assigned Numbers Authority <a href="http://www.iana.org/">[IANA]</a>,89* <a href="http://www.ietf.org/rfc/rfc2278.txt">[RFC2278]</a>90* or start with <code>X-</code>.</p>91* @see <a href="http://www.w3.org/TR/xslt#output">92* section 16 of the XSL Transformations (XSLT) W3C Recommendation</a>93*/94public static final String ENCODING = "encoding";9596/**97* omit-xml-declaration = "yes" | "no".98*99* <p><code>omit-xml-declaration</code> specifies whether the XSLT100* processor should output an XML declaration; the value must be101* <code>yes</code> or <code>no</code>.</p>102* @see <a href="http://www.w3.org/TR/xslt#output">103* section 16 of the XSL Transformations (XSLT) W3C Recommendation</a>104*/105public static final String OMIT_XML_DECLARATION = "omit-xml-declaration";106107/**108* standalone = "yes" | "no".109*110* <p><code>standalone</code> specifies whether the Transformer111* should output a standalone document declaration; the value must be112* <code>yes</code> or <code>no</code>.</p>113* @see <a href="http://www.w3.org/TR/xslt#output">114* section 16 of the XSL Transformations (XSLT) W3C Recommendation</a>115*/116public static final String STANDALONE = "standalone";117118/**119* doctype-public = <var>string</var>.120* <p>See the documentation for the {@link #DOCTYPE_SYSTEM} property121* for a description of what the value of the key should be.</p>122*123* @see <a href="http://www.w3.org/TR/xslt#output">124* section 16 of the XSL Transformations (XSLT) W3C Recommendation</a>125*/126public static final String DOCTYPE_PUBLIC = "doctype-public";127128/**129* doctype-system = <var>string</var>.130* <p><code>doctype-system</code> specifies the system identifier131* to be used in the document type declaration.</p>132* <p>If the doctype-system property is specified, the xml output method133* should output a document type declaration immediately before the first134* element. The name following <!DOCTYPE should be the name of the first135* element. If doctype-public property is also specified, then the xml136* output method should output PUBLIC followed by the public identifier137* and then the system identifier; otherwise, it should output SYSTEM138* followed by the system identifier. The internal subset should be empty.139* The value of the doctype-public property should be ignored unless the doctype-system140* property is specified.</p>141* <p>If the doctype-public or doctype-system properties are specified,142* then the html output method should output a document type declaration143* immediately before the first element. The name following <!DOCTYPE144* should be HTML or html. If the doctype-public property is specified,145* then the output method should output PUBLIC followed by the specified146* public identifier; if the doctype-system property is also specified,147* it should also output the specified system identifier following the148* public identifier. If the doctype-system property is specified but149* the doctype-public property is not specified, then the output method150* should output SYSTEM followed by the specified system identifier.</p>151*152* <p><code>doctype-system</code> specifies the system identifier153* to be used in the document type declaration.</p>154* @see <a href="http://www.w3.org/TR/xslt#output">155* section 16 of the XSL Transformations (XSLT) W3C Recommendation</a>156*/157public static final String DOCTYPE_SYSTEM = "doctype-system";158159/**160* cdata-section-elements = <var>expanded names</var>.161*162* <p><code>cdata-section-elements</code> specifies a whitespace delimited163* list of the names of elements whose text node children should be output164* using CDATA sections. Note that these names must use the format165* described in the section Qualfied Name Representation in166* {@link javax.xml.transform}.</p>167*168* @see <a href="http://www.w3.org/TR/xslt#output">169* section 16 of the XSL Transformations (XSLT) W3C Recommendation.</a>170*/171public static final String CDATA_SECTION_ELEMENTS =172"cdata-section-elements";173174/**175* indent = "yes" | "no".176*177* <p><code>indent</code> specifies whether the Transformer may178* add additional whitespace when outputting the result tree; the value179* must be <code>yes</code> or <code>no</code>. </p>180* @see <a href="http://www.w3.org/TR/xslt#output">181* section 16 of the XSL Transformations (XSLT) W3C Recommendation</a>182*/183public static final String INDENT = "indent";184185/**186* media-type = <var>string</var>.187*188* <p><code>media-type</code> specifies the media type (MIME189* content type) of the data that results from outputting the result190* tree. The <code>charset</code> parameter should not be specified191* explicitly; instead, when the top-level media type is192* <code>text</code>, a <code>charset</code> parameter should be added193* according to the character encoding actually used by the output194* method. </p>195* @see <a href="http://www.w3.org/TR/xslt#output">s196* ection 16 of the XSL Transformations (XSLT) W3C Recommendation</a>197*/198public static final String MEDIA_TYPE = "media-type";199}200201202